mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Use the block form of module()
(#17151)
This commit is contained in:
@@ -1,22 +1,26 @@
|
||||
import { module, test } from "qunit";
|
||||
import Theme from "admin/models/theme";
|
||||
|
||||
module("Unit | Model | theme");
|
||||
module("Unit | Model | theme", function () {
|
||||
test("can add an upload correctly", function (assert) {
|
||||
let theme = Theme.create();
|
||||
|
||||
test("can add an upload correctly", function (assert) {
|
||||
let theme = Theme.create();
|
||||
assert.strictEqual(
|
||||
theme.get("uploads.length"),
|
||||
0,
|
||||
"uploads should be an empty array"
|
||||
);
|
||||
|
||||
assert.strictEqual(
|
||||
theme.get("uploads.length"),
|
||||
0,
|
||||
"uploads should be an empty array"
|
||||
);
|
||||
theme.setField("common", "bob", "", 999, 2);
|
||||
let fields = theme.get("theme_fields");
|
||||
assert.strictEqual(fields.length, 1, "expecting 1 theme field");
|
||||
assert.strictEqual(
|
||||
fields[0].upload_id,
|
||||
999,
|
||||
"expecting upload id to be set"
|
||||
);
|
||||
assert.strictEqual(fields[0].type_id, 2, "expecting type id to be set");
|
||||
|
||||
theme.setField("common", "bob", "", 999, 2);
|
||||
let fields = theme.get("theme_fields");
|
||||
assert.strictEqual(fields.length, 1, "expecting 1 theme field");
|
||||
assert.strictEqual(fields[0].upload_id, 999, "expecting upload id to be set");
|
||||
assert.strictEqual(fields[0].type_id, 2, "expecting type id to be set");
|
||||
|
||||
assert.strictEqual(theme.get("uploads.length"), 1, "expecting an upload");
|
||||
assert.strictEqual(theme.get("uploads.length"), 1, "expecting an upload");
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user