mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 21:41:47 +08:00
Revert "Rename all test files from JS -> ES6"
This reverts commit 2abe85b8344de1102c1589a9ac9421a8b296f2b5.
This commit is contained in:
@ -1,55 +0,0 @@
|
||||
import selectKit from "helpers/select-kit-helper";
|
||||
import componentTest from "helpers/component-test";
|
||||
import Topic from "discourse/models/topic";
|
||||
|
||||
const buildTopic = function(pinned = true) {
|
||||
return Topic.create({
|
||||
id: 1234,
|
||||
title: "Qunit Test Topic",
|
||||
deleted: false,
|
||||
pinned
|
||||
});
|
||||
};
|
||||
|
||||
moduleForComponent("select-kit/pinned-options", {
|
||||
integration: true,
|
||||
beforeEach: function() {
|
||||
this.set("subject", selectKit());
|
||||
}
|
||||
});
|
||||
|
||||
componentTest("unpinning", {
|
||||
template: "{{pinned-options value=topic.pinned topic=topic}}",
|
||||
|
||||
beforeEach() {
|
||||
this.siteSettings.automatically_unpin_topics = false;
|
||||
this.set("topic", buildTopic());
|
||||
},
|
||||
|
||||
async test(assert) {
|
||||
assert.equal(this.subject.header().name(), "pinned");
|
||||
|
||||
await this.subject.expand();
|
||||
await this.subject.selectRowByValue("unpinned");
|
||||
|
||||
assert.equal(this.subject.header().name(), "unpinned");
|
||||
}
|
||||
});
|
||||
|
||||
componentTest("pinning", {
|
||||
template: "{{pinned-options value=topic.pinned topic=topic}}",
|
||||
|
||||
beforeEach() {
|
||||
this.siteSettings.automatically_unpin_topics = false;
|
||||
this.set("topic", buildTopic(false));
|
||||
},
|
||||
|
||||
async test(assert) {
|
||||
assert.equal(this.subject.header().name(), "unpinned");
|
||||
|
||||
await this.subject.expand();
|
||||
await this.subject.selectRowByValue("pinned");
|
||||
|
||||
assert.equal(this.subject.header().name(), "pinned");
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user