DEV: introduces prettier for es6 files
This commit is contained in:
@@ -1,26 +1,30 @@
|
||||
import AdminUser from 'admin/models/admin-user';
|
||||
import ApiKey from 'admin/models/api-key';
|
||||
import AdminUser from "admin/models/admin-user";
|
||||
import ApiKey from "admin/models/api-key";
|
||||
|
||||
QUnit.module("model:admin-user");
|
||||
|
||||
QUnit.test('generate key', function(assert) {
|
||||
QUnit.test("generate key", function(assert) {
|
||||
assert.expect(2);
|
||||
|
||||
var adminUser = AdminUser.create({id: 333});
|
||||
assert.ok(!adminUser.get('api_key'), 'it has no api key by default');
|
||||
var adminUser = AdminUser.create({ id: 333 });
|
||||
assert.ok(!adminUser.get("api_key"), "it has no api key by default");
|
||||
return adminUser.generateApiKey().then(function() {
|
||||
assert.present(adminUser.get('api_key'), 'it has an api_key now');
|
||||
assert.present(adminUser.get("api_key"), "it has an api_key now");
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.test('revoke key', function(assert) {
|
||||
QUnit.test("revoke key", function(assert) {
|
||||
assert.expect(2);
|
||||
|
||||
var apiKey = ApiKey.create({id: 1234, key: 'asdfasdf'}),
|
||||
adminUser = AdminUser.create({id: 333, api_key: apiKey});
|
||||
var apiKey = ApiKey.create({ id: 1234, key: "asdfasdf" }),
|
||||
adminUser = AdminUser.create({ id: 333, api_key: apiKey });
|
||||
|
||||
assert.equal(adminUser.get('api_key'), apiKey, 'it has the api key in the beginning');
|
||||
assert.equal(
|
||||
adminUser.get("api_key"),
|
||||
apiKey,
|
||||
"it has the api key in the beginning"
|
||||
);
|
||||
return adminUser.revokeApiKey().then(function() {
|
||||
assert.blank(adminUser.get('api_key'), 'it cleared the api_key');
|
||||
assert.blank(adminUser.get("api_key"), "it cleared the api_key");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
import Theme from 'admin/models/theme';
|
||||
import Theme from "admin/models/theme";
|
||||
|
||||
QUnit.module("model:theme");
|
||||
|
||||
QUnit.test('can add an upload correctly', function(assert) {
|
||||
QUnit.test("can add an upload correctly", function(assert) {
|
||||
let theme = Theme.create();
|
||||
|
||||
assert.equal(theme.get("uploads.length"), 0, "uploads should be an empty array");
|
||||
assert.equal(
|
||||
theme.get("uploads.length"),
|
||||
0,
|
||||
"uploads should be an empty array"
|
||||
);
|
||||
|
||||
theme.setField('common', 'bob', '', 999, 2);
|
||||
theme.setField("common", "bob", "", 999, 2);
|
||||
let fields = theme.get("theme_fields");
|
||||
assert.equal(fields.length, 1, 'expecting 1 theme field');
|
||||
assert.equal(fields[0].upload_id, 999, 'expecting upload id to be set');
|
||||
assert.equal(fields[0].type_id, 2, 'expecting type id to be set');
|
||||
assert.equal(fields.length, 1, "expecting 1 theme field");
|
||||
assert.equal(fields[0].upload_id, 999, "expecting upload id to be set");
|
||||
assert.equal(fields[0].type_id, 2, "expecting type id to be set");
|
||||
|
||||
assert.equal(theme.get("uploads.length"), 1, "expecting an upload");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user