mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 13:53:45 +08:00
Fix broken JS tests.
This commit is contained in:
parent
c25730935e
commit
793ccd144e
|
@ -17,13 +17,9 @@ QUnit.test('updateFromJson', assert => {
|
|||
var details = buildDetails(1234);
|
||||
|
||||
details.updateFromJson({
|
||||
suggested_topics: [{id: 1}, {id: 3}],
|
||||
allowed_users: [{username: 'eviltrout'}]
|
||||
});
|
||||
|
||||
assert.equal(details.get('suggested_topics.length'), 2, 'it loaded the suggested_topics');
|
||||
assert.containsInstance(details.get('suggested_topics'), Topic);
|
||||
|
||||
assert.equal(details.get('allowed_users.length'), 1, 'it loaded the allowed users');
|
||||
assert.containsInstance(details.get('allowed_users'), Discourse.User);
|
||||
|
||||
|
|
|
@ -24,6 +24,13 @@ QUnit.test('has a postStream', assert => {
|
|||
assert.equal(postStream.get('topic'), topic, "the postStream has a reference back to the topic");
|
||||
});
|
||||
|
||||
QUnit.test('has suggestedTopics', assert => {
|
||||
const topic = Topic.create({ suggested_topics: [{ id: 1 }, { id: 2 }] });
|
||||
const suggestedTopics = topic.get('suggestedTopics');
|
||||
|
||||
assert.equal(suggestedTopics.length, 2, 'it loaded the suggested_topics');
|
||||
assert.containsInstance(suggestedTopics, Topic);
|
||||
});
|
||||
|
||||
QUnit.test('category relationship', assert => {
|
||||
// It finds the category by id
|
||||
|
|
Loading…
Reference in New Issue
Block a user