mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 15:58:17 +08:00
Enable JSHINT's unused
option. It caught a bunch of suspicious stuff which is fixed in this commit.
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
module("Discourse.Composer");
|
||||
|
||||
test('replyLength', function() {
|
||||
var replyLength = function(val, expectedLength, text) {
|
||||
var replyLength = function(val, expectedLength) {
|
||||
var composer = Discourse.Composer.create({ reply: val });
|
||||
equal(composer.get('replyLength'), expectedLength);
|
||||
};
|
||||
|
@ -227,7 +227,7 @@ test("storePost", function() {
|
||||
test("identity map", function() {
|
||||
var postStream = buildStream(1234);
|
||||
var p1 = postStream.appendPost(Discourse.Post.create({id: 1, post_number: 1}));
|
||||
var p3 = postStream.appendPost(Discourse.Post.create({id: 3, post_number: 4}));
|
||||
postStream.appendPost(Discourse.Post.create({id: 3, post_number: 4}));
|
||||
|
||||
equal(postStream.findLoadedPost(1), p1, "it can return cached posts by id");
|
||||
blank(postStream.findLoadedPost(4), "it can't find uncached posts");
|
||||
@ -403,7 +403,7 @@ test("comitting and triggerNewPostInStream race condition", function() {
|
||||
var user = Discourse.User.create({username: 'eviltrout', name: 'eviltrout', id: 321});
|
||||
var stagedPost = Discourse.Post.create({ raw: 'hello world this is my new post' });
|
||||
|
||||
var result = postStream.stagePost(stagedPost, user);
|
||||
postStream.stagePost(stagedPost, user);
|
||||
equal(postStream.get('filteredPostsCount'), 0, "it has no filteredPostsCount yet");
|
||||
stagedPost.set('id', 123);
|
||||
|
||||
|
Reference in New Issue
Block a user