DEV: Use the block form of module() (#17151)

This commit is contained in:
Jarek Radosz
2022-06-20 15:42:10 +02:00
committed by GitHub
parent 321118f384
commit ba2c7b8f35
4 changed files with 713 additions and 709 deletions

View File

@@ -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");
});
});