We used many global functions to handle tests when they should be imported like other libraries in our application. This also gets us closer to the way Ember CLI prefers our tests to be laid out.
23 lines
463 B
JavaScript
23 lines
463 B
JavaScript
import { test, module } from "qunit";
|
|
import Group from "discourse/models/group";
|
|
|
|
module("model:group");
|
|
|
|
test("displayName", (assert) => {
|
|
const group = Group.create({ name: "test", display_name: "donkey" });
|
|
|
|
assert.equal(
|
|
group.get("displayName"),
|
|
"donkey",
|
|
"it should return the display name"
|
|
);
|
|
|
|
group.set("display_name", null);
|
|
|
|
assert.equal(
|
|
group.get("displayName"),
|
|
"test",
|
|
"it should return the group's name"
|
|
);
|
|
});
|