mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 13:51:03 +08:00
ES6: Convert all test files over
This commit is contained in:
21
test/javascripts/models/topic-tracking-state-test.js.es6
Normal file
21
test/javascripts/models/topic-tracking-state-test.js.es6
Normal file
@ -0,0 +1,21 @@
|
||||
module("Discourse.TopicTrackingState");
|
||||
|
||||
test("sync", function () {
|
||||
|
||||
var state = Discourse.TopicTrackingState.create();
|
||||
// fake track it
|
||||
state.states["t111"] = {last_read_post_number: null};
|
||||
|
||||
state.updateSeen(111, 7);
|
||||
var list = {topics: [{
|
||||
highest_post_number: null,
|
||||
id: 111,
|
||||
unread: 10,
|
||||
new_posts: 10
|
||||
}]};
|
||||
|
||||
state.sync(list, "new");
|
||||
|
||||
equal(list.topics.length, 0, "expect new topic to be removed as it was seen");
|
||||
|
||||
});
|
Reference in New Issue
Block a user