mirror of
https://github.com/discourse/discourse.git
synced 2024-12-20 09:03:45 +08:00
874999941a
Includes: * DEV: Don't overwrite a computed property in test
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
QUnit.module("lib:emoji-store", {
|
|
beforeEach() {
|
|
const store = Discourse.__container__.lookup("service:emoji-store");
|
|
store.reset();
|
|
},
|
|
afterEach() {
|
|
const store = Discourse.__container__.lookup("service:emoji-store");
|
|
store.reset();
|
|
}
|
|
});
|
|
|
|
QUnit.test("defaults", assert => {
|
|
const store = Discourse.__container__.lookup("service:emoji-store");
|
|
assert.deepEqual(store.favorites, []);
|
|
assert.equal(store.diversity, 1);
|
|
});
|
|
|
|
QUnit.test("diversity", assert => {
|
|
const store = Discourse.__container__.lookup("service:emoji-store");
|
|
store.diversity = 2;
|
|
assert.equal(store.diversity, 2);
|
|
});
|
|
|
|
QUnit.test("favorites", assert => {
|
|
const store = Discourse.__container__.lookup("service:emoji-store");
|
|
store.favorites = ["smile"];
|
|
assert.deepEqual(store.favorites, ["smile"]);
|
|
});
|
|
|
|
QUnit.test("track", assert => {
|
|
const store = Discourse.__container__.lookup("service:emoji-store");
|
|
store.track("woman:t4");
|
|
assert.deepEqual(store.favorites, ["woman:t4"]);
|
|
store.track("otter");
|
|
store.track(":otter:");
|
|
assert.deepEqual(store.favorites, ["otter", "woman:t4"]);
|
|
});
|