Upgrade QUnit to latest version

This commit is contained in:
Robin Ward
2017-06-14 13:57:58 -04:00
parent 8ae445766f
commit cc525b1a8d
145 changed files with 7569 additions and 6763 deletions

View File

@ -1,4 +1,4 @@
module("mixin:selected-posts-count");
QUnit.module("mixin:selected-posts-count");
import SelectedPostsCount from 'discourse/mixins/selected-posts-count';
import Topic from 'discourse/models/topic';
@ -7,30 +7,30 @@ var buildTestObj = function(params) {
return Ember.Object.extend(SelectedPostsCount).create(params || {});
};
test("without selectedPosts", function () {
QUnit.test("without selectedPosts", assert => {
var testObj = buildTestObj();
equal(testObj.get('selectedPostsCount'), 0, "No posts are selected without a selectedPosts property");
assert.equal(testObj.get('selectedPostsCount'), 0, "No posts are selected without a selectedPosts property");
testObj.set('selectedPosts', []);
equal(testObj.get('selectedPostsCount'), 0, "No posts are selected when selectedPosts is an empty array");
assert.equal(testObj.get('selectedPostsCount'), 0, "No posts are selected when selectedPosts is an empty array");
});
test("with some selectedPosts", function() {
QUnit.test("with some selectedPosts", assert => {
var testObj = buildTestObj({ selectedPosts: [Discourse.Post.create({id: 123})] });
equal(testObj.get('selectedPostsCount'), 1, "It returns the amount of posts");
assert.equal(testObj.get('selectedPostsCount'), 1, "It returns the amount of posts");
});
test("when all posts are selected and there is a posts_count", function() {
QUnit.test("when all posts are selected and there is a posts_count", assert => {
var testObj = buildTestObj({ allPostsSelected: true, posts_count: 1024 });
equal(testObj.get('selectedPostsCount'), 1024, "It returns the posts_count");
assert.equal(testObj.get('selectedPostsCount'), 1024, "It returns the posts_count");
});
test("when all posts are selected and there is topic with a posts_count", function() {
QUnit.test("when all posts are selected and there is topic with a posts_count", assert => {
var testObj = buildTestObj({
allPostsSelected: true,
topic: Topic.create({ posts_count: 3456 })
});
equal(testObj.get('selectedPostsCount'), 3456, "It returns the topic's posts_count");
});
assert.equal(testObj.get('selectedPostsCount'), 3456, "It returns the topic's posts_count");
});