mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
Fix broken JS tests.
This commit is contained in:
@ -17,13 +17,9 @@ QUnit.test('updateFromJson', assert => {
|
|||||||
var details = buildDetails(1234);
|
var details = buildDetails(1234);
|
||||||
|
|
||||||
details.updateFromJson({
|
details.updateFromJson({
|
||||||
suggested_topics: [{id: 1}, {id: 3}],
|
|
||||||
allowed_users: [{username: 'eviltrout'}]
|
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.equal(details.get('allowed_users.length'), 1, 'it loaded the allowed users');
|
||||||
assert.containsInstance(details.get('allowed_users'), Discourse.User);
|
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");
|
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 => {
|
QUnit.test('category relationship', assert => {
|
||||||
// It finds the category by id
|
// It finds the category by id
|
||||||
|
Reference in New Issue
Block a user