mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-23 14:02:33 -05:00
22 lines
453 B
Text
22 lines
453 B
Text
|
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");
|
||
|
|
||
|
});
|