Chore update eslint and plugins update (#1171)

This commit is contained in:
Carlos Alcaide Corvo authored and GitHub committed 2022-07-07 11:18:51 -07:00
1 parent 923526ad26
commit 6f8afbb7af
161 files changed
+786 -772

No files matched your search

+4 -4
View File
@@ -59,11 +59,11 @@
"ember-resolver": "^8.0.3",
"ember-source": "~3.28.4",
"ember-template-lint": "^3.7.0",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.9",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-ember": "^10.6.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-qunit": "^6.2.0",
"eslint-plugin-qunit": "^7.3.0",
"js-bexpr": "hashicorp/js-bexpr#9b4a4b54d85eba67fdfc0990133d1518d890b1e1",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
@@ -19,20 +19,20 @@ module('Unit | Adapter | application', function (hooks) {
assert.expect(2);
const adapter = this.owner.lookup('adapter:application');
assert.ok(adapter.namespace);
assert.equal(adapter.namespace, config.api.namespace);
assert.strictEqual(adapter.namespace, config.api.namespace);
});
test('it generates correct URL prefixes', function (assert) {
assert.expect(2);
const adapter = this.owner.lookup('adapter:application');
assert.ok(config.api.namespace);
assert.equal(adapter.urlPrefix(), config.api.namespace);
assert.strictEqual(adapter.urlPrefix(), config.api.namespace);
});
test('it generates correct default URL suffixes', function (assert) {
assert.expect(1);
const adapter = this.owner.lookup('adapter:application');
assert.equal(adapter.urlSuffix(), '');
assert.strictEqual(adapter.urlSuffix(), '');
});
test('it generates URL suffixes with optional `method` from adapterOptions', function (assert) {
@@ -43,7 +43,7 @@ module('Unit | Adapter | application', function (hooks) {
adapterOptions: { method },
});
assert.ok(config.api.namespace);
assert.equal(suffix, ':set-something');
assert.strictEqual(suffix, ':set-something');
});
test('it generates correct complete URLs', function (assert) {
@@ -64,44 +64,44 @@ module('Unit | Adapter | application', function (hooks) {
mockSnapshot,
'findRecord'
);
assert.equal(findRecordURL, '/v1/users/1:my-custom-method');
assert.strictEqual(findRecordURL, '/v1/users/1:my-custom-method');
const findAllURL = adapter.buildURL('user', null, mockSnapshot, 'findAll');
assert.equal(findAllURL, '/v1/users:my-custom-method');
assert.strictEqual(findAllURL, '/v1/users:my-custom-method');
const findBelongsToURL = adapter.buildURL(
'user',
'2',
mockSnapshot,
'findBelongsTo'
);
assert.equal(findBelongsToURL, '/v1/users/2:my-custom-method');
assert.strictEqual(findBelongsToURL, '/v1/users/2:my-custom-method');
const createRecordURL = adapter.buildURL(
'user',
null,
mockSnapshot,
'createRecord'
);
assert.equal(createRecordURL, '/v1/users:my-custom-method');
assert.strictEqual(createRecordURL, '/v1/users:my-custom-method');
const updateRecordURL = adapter.buildURL(
'user',
'3',
mockSnapshot,
'updateRecord'
);
assert.equal(updateRecordURL, '/v1/users/3:my-custom-method');
assert.strictEqual(updateRecordURL, '/v1/users/3:my-custom-method');
const deleteRecordURL = adapter.buildURL(
'user',
'4',
mockSnapshot,
'deleteRecord'
);
assert.equal(deleteRecordURL, '/v1/users/4:my-custom-method');
assert.strictEqual(deleteRecordURL, '/v1/users/4:my-custom-method');
});
test('it can request records through the store from a specified scope', async function (assert) {
assert.expect(1);
const store = this.owner.lookup('service:store');
this.server.get('/v1/groups', (_, { queryParams: { scope_id } }) => {
assert.equal(scope_id, 'p_456', 'Scoped resource URL was requested.');
assert.strictEqual(scope_id, 'p_456', 'Scoped resource URL was requested.');
return { items: [] };
});
await store.query('group', { scope_id: 'p_456' });
@@ -113,7 +113,7 @@ module('Unit | Adapter | application', function (hooks) {
// TODO this is icky, should be changed to a spy or stub
const originalAjax = RESTAdapter.prototype.ajax;
RESTAdapter.prototype.ajax = (url, type) => {
assert.equal(type, 'PATCH');
assert.strictEqual(type, 'PATCH');
RESTAdapter.prototype.ajax = originalAjax;
};
adapter.ajax('/', 'PUT');
@@ -130,7 +130,7 @@ module('Unit | Adapter | application', function (hooks) {
// TODO this is icky, should be changed to a spy or stub
const originalAjax = RESTAdapter.prototype.ajax;
RESTAdapter.prototype.ajax = (url, type) => {
assert.equal(type, 'POST');
assert.strictEqual(type, 'POST');
RESTAdapter.prototype.ajax = originalAjax;
};
adapter.updateRecord(store, { modelName: 'user' }, snapshot);
@@ -167,8 +167,8 @@ module('Unit | Adapter | application', function (hooks) {
};
const handledResponse = adapter.handleResponse(400, {}, payload);
assert.ok(handledResponse instanceof InvalidError);
assert.equal(handledResponse.errors.length, 1);
assert.equal(handledResponse.message, 'The request was invalid.');
assert.strictEqual(handledResponse.errors.length, 1);
assert.strictEqual(handledResponse.message, 'The request was invalid.');
assert.ok(handledResponse.errors[0].isInvalid);
});
@@ -197,7 +197,7 @@ module('Unit | Adapter | application', function (hooks) {
},
};
const handledResponse = adapter.handleResponse(400, {}, payload);
assert.equal(
assert.strictEqual(
handledResponse.errors.length,
2,
'A base error plus one field error'
@@ -22,7 +22,7 @@ module('Unit | Adapter | host catalog', function (hooks) {
mockSnapshot,
'createRecord'
);
assert.equal(createRecordURL, '/v1/host-catalogs');
assert.strictEqual(createRecordURL, '/v1/host-catalogs');
});
test('it generates correct createRecord URLs for dynamic host catalogs with extra query parameter ?plugin_name', function (assert) {
@@ -43,6 +43,6 @@ module('Unit | Adapter | host catalog', function (hooks) {
mockSnapshot,
'createRecord'
);
assert.equal(createRecordURL, '/v1/host-catalogs?plugin_name=aws');
assert.strictEqual(createRecordURL, '/v1/host-catalogs?plugin_name=aws');
});
});
@@ -14,7 +14,7 @@ module('Unit | Mixin | build-url', function (hooks) {
this.owner.register('adapter:adapter', Adapter);
const adapter = this.owner.lookup('adapter:adapter');
const url = adapter._buildURL('model', 1);
assert.equal(url, '/models/1');
assert.strictEqual(url, '/models/1');
});
test('it does not interfere with namespaced URLs', function (assert) {
@@ -26,7 +26,7 @@ module('Unit | Mixin | build-url', function (hooks) {
this.owner.register('adapter:adapter', Adapter);
const adapter = this.owner.lookup('adapter:adapter');
const url = adapter._buildURL('model', 1);
assert.equal(url, '/api/v1/models/1');
assert.strictEqual(url, '/api/v1/models/1');
});
test('it can prepend a prefix', function (assert) {
@@ -40,7 +40,7 @@ module('Unit | Mixin | build-url', function (hooks) {
this.owner.register('adapter:adapter', Adapter);
const adapter = this.owner.lookup('adapter:adapter');
const url = adapter._buildURL('model', 1);
assert.equal(url, '/foo/bars/models/1');
assert.strictEqual(url, '/foo/bars/models/1');
});
test('it can append a suffix', function (assert) {
@@ -54,6 +54,6 @@ module('Unit | Mixin | build-url', function (hooks) {
this.owner.register('adapter:adapter', Adapter);
const adapter = this.owner.lookup('adapter:adapter');
const url = adapter._buildURL('model', 1);
assert.equal(url, '/models/1:method');
assert.strictEqual(url, '/models/1:method');
});
});
+1 -1
View File
@@ -18,6 +18,6 @@ module('Unit | Model | account', function (hooks) {
});
assert.notOk(model.accountName);
model.login_name = 'foobar';
assert.equal(model.accountName, 'foobar');
assert.strictEqual(model.accountName, 'foobar');
});
});
+6 -6
View File
@@ -36,8 +36,8 @@ module('Unit | Model | base', function (hooks) {
});
const scope = store.peekRecord('scope', 'o_1');
const model = store.peekRecord('user', '123abc');
assert.equal(model.scope.scope_id, scope.id);
assert.equal(model.scopeModel.id, scope.id);
assert.strictEqual(model.scope.scope_id, scope.id);
assert.strictEqual(model.scopeModel.id, scope.id);
});
test('it may accept a `scopeModel` for convenience, instead of a fragment', function (assert) {
@@ -47,7 +47,7 @@ module('Unit | Model | base', function (hooks) {
const model = store.createRecord('user', '123abc');
assert.notEqual(model.scopeID, scope.id);
model.scopeModel = scope;
assert.equal(model.scopeID, scope.id);
assert.strictEqual(model.scopeID, scope.id);
assert.true(model.scope.isOrg);
});
@@ -62,10 +62,10 @@ module('Unit | Model | base', function (hooks) {
},
});
const model = store.peekRecord('user', '123abc');
assert.equal(model.name, null);
assert.equal(model.displayName, '123abc');
assert.strictEqual(model.name, undefined);
assert.strictEqual(model.displayName, '123abc');
model.name = 'Test';
assert.equal(model.displayName, 'Test');
assert.strictEqual(model.displayName, 'Test');
});
test('it has canSave and cannotSave attributes', function (assert) {
+5 -5
View File
@@ -19,12 +19,12 @@ module('Unit | Model | group', function (hooks) {
},
});
const group = store.peekRecord('group', 'group_123');
assert.equal(
assert.strictEqual(
group.member_ids.length,
2,
'Group has two entires in member_ids'
);
assert.equal(
assert.strictEqual(
group.members.length,
0,
'Group has no resolved members because they are not loaded yet'
@@ -45,12 +45,12 @@ module('Unit | Model | group', function (hooks) {
});
// eslint-disable-next-line no-self-assign
group.member_ids = [...group.member_ids];
assert.equal(
assert.strictEqual(
group.member_ids.length,
2,
'Group has two entires in member_ids'
);
assert.equal(group.members.length, 2, 'Group has two resolved members');
assert.strictEqual(group.members.length, 2, 'Group has two resolved members');
});
test('it has an `addMembers` method that groups a specific POST API endpoint and serialization', async function (assert) {
@@ -156,7 +156,7 @@ module('Unit | Model | group', function (hooks) {
},
});
const group = store.peekRecord('group', 'group_123');
assert.equal(
assert.strictEqual(
group.member_ids.length,
0,
'Group has empty member_ids by default'
@@ -95,9 +95,9 @@ module('Unit | Model | host catalog', function (hooks) {
type: 'plugin',
plugin: { name: 'no-such-type' },
});
assert.equal(modelA.compositeType, 'static');
assert.equal(modelB.compositeType, 'aws');
assert.equal(modelC.compositeType, 'unknown');
assert.strictEqual(modelA.compositeType, 'static');
assert.strictEqual(modelB.compositeType, 'aws');
assert.strictEqual(modelC.compositeType, 'unknown');
});
test('set compositeType sets expected values', async function (assert) {
@@ -109,8 +109,8 @@ module('Unit | Model | host catalog', function (hooks) {
const modelStatic = store.createRecord('host-catalog', {
compositeType: 'static',
});
assert.equal(modelPlugin.type, 'plugin');
assert.equal(modelPlugin.plugin.name, 'aws');
assert.equal(modelStatic.type, 'static');
assert.strictEqual(modelPlugin.type, 'plugin');
assert.strictEqual(modelPlugin.plugin.name, 'aws');
assert.strictEqual(modelStatic.type, 'static');
});
});
+10 -10
View File
@@ -135,7 +135,7 @@ module('Unit | Model | host set', function (hooks) {
const store = this.owner.lookup('service:store');
const modelA = store.createRecord('host-set', { type: 'static' });
const modelB = store.createRecord('host-set', { type: 'plugin' });
assert.equal(typeof modelA.isStatic, 'boolean');
assert.strictEqual(typeof modelA.isStatic, 'boolean');
assert.true(modelA.isStatic);
assert.false(modelB.isStatic);
});
@@ -145,7 +145,7 @@ module('Unit | Model | host set', function (hooks) {
const store = this.owner.lookup('service:store');
const modelPlugin = store.createRecord('host-set', { type: 'plugin' });
const modelStatic = store.createRecord('host-set', { type: 'static' });
assert.equal(typeof modelPlugin.isPlugin, 'boolean');
assert.strictEqual(typeof modelPlugin.isPlugin, 'boolean');
assert.true(modelPlugin.isPlugin);
assert.false(modelStatic.isPlugin);
});
@@ -160,7 +160,7 @@ module('Unit | Model | host set', function (hooks) {
const modelRandom = store.createRecord('host-set', {
plugin: { name: 'random' },
});
assert.equal(typeof modelAws.isAWS, 'boolean');
assert.strictEqual(typeof modelAws.isAWS, 'boolean');
assert.true(modelAws.isAWS);
assert.false(modelRandom.isAWS);
});
@@ -175,7 +175,7 @@ module('Unit | Model | host set', function (hooks) {
const modelRandom = store.createRecord('host-set', {
plugin: { name: 'random' },
});
assert.equal(typeof modelAzure.isAzure, 'boolean');
assert.strictEqual(typeof modelAzure.isAzure, 'boolean');
assert.true(modelAzure.isAzure);
assert.false(modelRandom.isAzure);
});
@@ -194,9 +194,9 @@ module('Unit | Model | host set', function (hooks) {
const modelStatic = store.createRecord('host-set', {
type: 'static',
});
assert.equal(modelPlugin1.compositeType, 'aws');
assert.equal(modelPlugin2.compositeType, 'unknown');
assert.equal(modelStatic.compositeType, 'static');
assert.strictEqual(modelPlugin1.compositeType, 'aws');
assert.strictEqual(modelPlugin2.compositeType, 'unknown');
assert.strictEqual(modelStatic.compositeType, 'static');
});
test('set compositeType sets expected values', async function (assert) {
@@ -209,8 +209,8 @@ module('Unit | Model | host set', function (hooks) {
compositeType: 'static',
});
assert.equal(modelPlugin.type, 'plugin');
assert.equal(modelPlugin.plugin.name, 'aws');
assert.equal(modelStatic.type, 'static');
assert.strictEqual(modelPlugin.type, 'plugin');
assert.strictEqual(modelPlugin.plugin.name, 'aws');
assert.strictEqual(modelStatic.type, 'static');
});
});
+11 -11
View File
@@ -20,7 +20,7 @@ module('Unit | Model | host', function (hooks) {
address: '127.0.0.1',
},
});
assert.equal(model.attributes.address, '127.0.0.1');
assert.strictEqual(model.attributes.address, '127.0.0.1');
});
test('it has isStatic and returns the expected values', async function (assert) {
@@ -28,7 +28,7 @@ module('Unit | Model | host', function (hooks) {
const store = this.owner.lookup('service:store');
const modelA = store.createRecord('host', { type: 'static' });
const modelB = store.createRecord('host', { type: 'plugin' });
assert.equal(typeof modelA.isStatic, 'boolean');
assert.strictEqual(typeof modelA.isStatic, 'boolean');
assert.true(modelA.isStatic);
assert.false(modelB.isStatic);
});
@@ -38,7 +38,7 @@ module('Unit | Model | host', function (hooks) {
const store = this.owner.lookup('service:store');
const modelPlugin = store.createRecord('host', { type: 'plugin' });
const modelStatic = store.createRecord('host', { type: 'static' });
assert.equal(typeof modelPlugin.isPlugin, 'boolean');
assert.strictEqual(typeof modelPlugin.isPlugin, 'boolean');
assert.true(modelPlugin.isPlugin);
assert.false(modelStatic.isPlugin);
});
@@ -53,7 +53,7 @@ module('Unit | Model | host', function (hooks) {
const modelRandom = store.createRecord('host', {
plugin: { name: 'random' },
});
assert.equal(typeof modelAws.isAWS, 'boolean');
assert.strictEqual(typeof modelAws.isAWS, 'boolean');
assert.true(modelAws.isAWS);
assert.false(modelRandom.isAWS);
});
@@ -68,7 +68,7 @@ module('Unit | Model | host', function (hooks) {
const modelRandom = store.createRecord('host', {
plugin: { name: 'random' },
});
assert.equal(typeof modelAzure.isAzure, 'boolean');
assert.strictEqual(typeof modelAzure.isAzure, 'boolean');
assert.true(modelAzure.isAzure);
assert.false(modelRandom.isAzure);
});
@@ -83,9 +83,9 @@ module('Unit | Model | host', function (hooks) {
const modelStatic = store.createRecord('host', {
type: 'static',
});
assert.equal(typeof modelPlugin.compositeType, 'string');
assert.equal(modelPlugin.compositeType, 'Test name');
assert.equal(modelStatic.compositeType, 'static');
assert.strictEqual(typeof modelPlugin.compositeType, 'string');
assert.strictEqual(modelPlugin.compositeType, 'Test name');
assert.strictEqual(modelStatic.compositeType, 'static');
});
test('set compositeType sets expected values', async function (assert) {
@@ -98,8 +98,8 @@ module('Unit | Model | host', function (hooks) {
compositeType: 'static',
});
assert.equal(modelPlugin.type, 'plugin');
assert.equal(modelPlugin.plugin.name, 'aws');
assert.equal(modelStatic.type, 'static');
assert.strictEqual(modelPlugin.type, 'plugin');
assert.strictEqual(modelPlugin.plugin.name, 'aws');
assert.strictEqual(modelStatic.type, 'static');
});
});
+5 -5
View File
@@ -25,27 +25,27 @@ module('Unit | Model | scope', function (hooks) {
await scopes.firstObject.get('scope'),
'Global scope has no parent'
);
assert.equal(
assert.strictEqual(
await scopes.objectAt(1).get('scope.scope_id'),
'global',
'Org 1 parent scope is global'
);
assert.equal(
assert.strictEqual(
await scopes.objectAt(2).get('scope.scope_id'),
'global',
'Org 2 parent scope is global'
);
assert.equal(
assert.strictEqual(
await scopes.objectAt(3).get('scope.scope_id'),
'o_1',
'Project 1 parent scope is org 1'
);
assert.equal(
assert.strictEqual(
await scopes.objectAt(4).get('scope.scope_id'),
'o_1',
'Project 2 parent scope is org 1'
);
assert.equal(
assert.strictEqual(
await scopes.objectAt(5).get('scope.scope_id'),
'o_2',
'Project 3 parent scope is org 2'
+2 -2
View File
@@ -52,11 +52,11 @@ module('Unit | Model | session', function (hooks) {
test('it computes a proxy attribute', function (assert) {
let store = this.owner.lookup('service:store');
let model = store.createRecord('session');
assert.equal(model.proxy, null);
assert.strictEqual(model.proxy, null);
model.setProperties({
proxy_address: 'localhost',
proxy_port: '12345',
});
assert.equal(model.proxy, 'localhost:12345');
assert.strictEqual(model.proxy, 'localhost:12345');
});
});
+11 -11
View File
@@ -22,12 +22,12 @@ module('Unit | Model | target', function (hooks) {
},
});
const target = store.peekRecord('target', '123abc');
assert.equal(
assert.strictEqual(
target.host_sources.length,
2,
'Target has two entires in host_sources'
);
assert.equal(
assert.strictEqual(
target.hostSets.length,
0,
'Target has no resolved hostSets because they are not loaded yet'
@@ -50,12 +50,12 @@ module('Unit | Model | target', function (hooks) {
// it's necessary to do this assignment to kick-off the computed update.
// eslint-disable-next-line no-self-assign
target.host_sources = target.host_sources;
assert.equal(
assert.strictEqual(
target.host_sources.length,
2,
'Target has two entires in host_sources'
);
assert.equal(target.hostSets.length, 2, 'Target has two resolved hostSets');
assert.strictEqual(target.hostSets.length, 2, 'Target has two resolved hostSets');
assert.notOk(
target.hostSets[0].hostCatalog,
'Host catalog was not resolved because it is not loaded yet'
@@ -193,7 +193,7 @@ module('Unit | Model | target', function (hooks) {
},
});
const target = store.peekRecord('target', '123abc');
assert.equal(target.sessions.length, 0);
assert.strictEqual(target.sessions.length, 0);
store.push({
data: {
id: '1',
@@ -215,12 +215,12 @@ module('Unit | Model | target', function (hooks) {
attributes: { target_id: '456xyz' },
},
});
assert.equal(
assert.strictEqual(
store.peekAll('session').length,
3,
'There are 3 sessions loaded in the store'
);
assert.equal(
assert.strictEqual(
target.sessions.length,
2,
'Target has two associated sessions loaded in the store'
@@ -240,12 +240,12 @@ module('Unit | Model | target', function (hooks) {
},
});
const target = store.peekRecord('target', '123abc');
assert.equal(
assert.strictEqual(
target.application_credential_source_ids.length,
2,
'Target has two entires in application_credential_source_ids'
);
assert.equal(
assert.strictEqual(
target.credentialLibraries.length,
0,
'Target has no resolved credentialLibraries because they are not loaded yet'
@@ -271,12 +271,12 @@ module('Unit | Model | target', function (hooks) {
target.application_credential_source_ids =
target.application_credential_source_ids;
/* eslint-enable no-self-assign */
assert.equal(
assert.strictEqual(
target.application_credential_source_ids.length,
2,
'Target has two entires in application_credential_source_ids'
);
assert.equal(
assert.strictEqual(
target.credentialLibraries.length,
2,
'Target has two resolved credentialLibraries'
+3 -3
View File
@@ -109,7 +109,7 @@ module('Unit | Model | user', function (hooks) {
},
});
const user = store.peekRecord('user', 'user_123');
assert.equal(
assert.strictEqual(
user.account_ids.length,
0,
'User has empty account_ids by default'
@@ -147,7 +147,7 @@ module('Unit | Model | user', function (hooks) {
const model = store.peekRecord('user', '123abc');
await model.removeAccount('3');
assert.equal(model.login_name, null);
assert.equal(model.name, 'newName');
assert.strictEqual(model.login_name, null);
assert.strictEqual(model.name, 'newName');
});
});
@@ -158,9 +158,9 @@ module('Unit | Serializer | auth method', function (hooks) {
}));
const record = await store.findRecord('auth-method', 'oidc123');
const { account_claim_maps } = record.attributes;
assert.equal(account_claim_maps.firstObject.from, 'from');
assert.equal(account_claim_maps.firstObject.to, 'to');
assert.equal(account_claim_maps.lastObject.from, 'foo');
assert.equal(account_claim_maps.lastObject.to, 'bar');
assert.strictEqual(account_claim_maps.firstObject.from, 'from');
assert.strictEqual(account_claim_maps.firstObject.to, 'to');
assert.strictEqual(account_claim_maps.lastObject.from, 'foo');
assert.strictEqual(account_claim_maps.lastObject.to, 'bar');
});
});
@@ -20,7 +20,7 @@ module('Unit | Serializer | fragment string', function (hooks) {
let serializedRecord = record.serialize();
assert.equal(serializedRecord, 'string value');
assert.strictEqual(serializedRecord, 'string value');
});
test('it normalizes records', function (assert) {
@@ -14,6 +14,6 @@ module('Unit | Service | resource-filter-store', function (hooks) {
});
const expected =
'("/item/type" == "oidc") and ("/item/status" == "active" or "/item/status" == "pending") and ("read" in "/item/authorized_actions")';
assert.equal(filter.queryExpression, expected);
assert.strictEqual(filter.queryExpression, expected);
});
});
@@ -8,14 +8,14 @@ module('Unit | Service | storage', function (hooks) {
assert.expect(1);
const service = this.owner.lookup('service:storage');
service.setItem('foo', 'bar');
assert.equal(service.getItem('foo'), 'bar');
assert.strictEqual(service.getItem('foo'), 'bar');
});
test('it can remove persisted values', function (assert) {
assert.expect(2);
const service = this.owner.lookup('service:storage');
service.setItem('foo', 'bar');
assert.equal(service.getItem('foo'), 'bar');
assert.strictEqual(service.getItem('foo'), 'bar');
service.removeItem('foo');
assert.notOk(service.getItem('foo'));
});
@@ -27,7 +27,7 @@ module('Unit | Service | storage', function (hooks) {
assert.expect(1);
const service = this.owner.lookup('service:storage');
service.setItem('foo', 'bar');
assert.equal(service.getItem('foo'), 'bar');
assert.strictEqual(service.getItem('foo'), 'bar');
});
test("it's in-memory storage is implicitly refreshed for every test case, and thus values from previous runs are not present", function (assert) {
+4 -4
View File
@@ -52,11 +52,11 @@
"ember-resolver": "^8.0.3",
"ember-source": "~3.28.4",
"ember-template-lint": "^3.7.0",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.9",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-ember": "^10.6.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-qunit": "^6.2.0",
"eslint-plugin-qunit": "^7.3.0",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.4.0",
@@ -84,7 +84,7 @@ module('Unit | Session Store | cookie', function (hooks) {
sessionStore.cookies.exists(sessionStore.cookieName),
'session cookie was not set'
);
assert.equal(
assert.strictEqual(
sessionStore.cookies.read(sessionStore.authenticatorCookieName),
'foobar'
);
+4 -4
View File
@@ -68,11 +68,11 @@
"ember-resolver": "^8.0.3",
"ember-source": "~3.28.4",
"ember-template-lint": "^3.7.0",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.9",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-ember": "^10.6.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-qunit": "^6.2.0",
"eslint-plugin-qunit": "^7.3.0",
"faker": "^5.5.3",
"js-bexpr": "hashicorp/js-bexpr#9b4a4b54d85eba67fdfc0990133d1518d890b1e1",
"loader.js": "^4.7.0",
@@ -8,41 +8,41 @@ module('Integration | Component | error/message', function (hooks) {
test('it renders predefined message for known error status', async function (assert) {
await render(hbs`<Error::Message @status='401' />`);
assert.equal(
assert.strictEqual(
find('.rose-message-title').textContent.trim(),
'You are not signed in'
);
assert.equal(
assert.strictEqual(
find('.rose-message-subtitle').textContent.trim(),
'Error 401'
);
assert.equal(
assert.strictEqual(
find('.rose-message-description').textContent.trim(),
'You are not signed in. Please sign in and try again later.'
);
await render(hbs`<Error::Message @status='403' />`);
assert.equal(
assert.strictEqual(
find('.rose-message-title').textContent.trim(),
'You are not authorized'
);
assert.equal(
assert.strictEqual(
find('.rose-message-subtitle').textContent.trim(),
'Error 403'
);
assert.equal(
assert.strictEqual(
find('.rose-message-description').textContent.trim(),
'You must be granted permissions to view this data. Ask your administrator if you think you should have access.'
);
await render(hbs`<Error::Message @status='404' />`);
assert.equal(
assert.strictEqual(
find('.rose-message-title').textContent.trim(),
'Resource not found'
);
assert.equal(
assert.strictEqual(
find('.rose-message-subtitle').textContent.trim(),
'Error 404'
);
assert.equal(
assert.strictEqual(
find('.rose-message-description').textContent.trim(),
'We could not find the requested resource. You can ask your administrator or try again later.'
);
@@ -50,15 +50,15 @@ module('Integration | Component | error/message', function (hooks) {
test('it renders default error for unknown error status', async function (assert) {
await render(hbs`<Error::Message @status='599' />`);
assert.equal(
assert.strictEqual(
find('.rose-message-title').textContent.trim(),
'Something went wrong'
);
assert.equal(
assert.strictEqual(
find('.rose-message-subtitle').textContent.trim(),
'Error 599'
);
assert.equal(
assert.strictEqual(
find('.rose-message-description').textContent.trim(),
"We're not sure what happened. Please contact your administrator or try again later."
);
@@ -15,14 +15,14 @@ module('Integration | Component | pending-confirmations', function (hooks) {
<div class="pending">Pending</div>
</PendingConfirmations>
`);
assert.equal(findAll('.pending').length, 0, 'No pending confirmations');
assert.strictEqual(findAll('.pending').length, 0, 'No pending confirmations');
service.confirm();
await render(hbs`
<PendingConfirmations as |confirmations|>
<div class="pending">Pending</div>
</PendingConfirmations>
`);
assert.equal(findAll('.pending').length, 1, 'One pending confirmations');
assert.strictEqual(findAll('.pending').length, 1, 'One pending confirmations');
});
test('it exposes a confirm action that confirms the confirmation', async function (assert) {
@@ -9,6 +9,6 @@ module('Integration | Helper | app-name', function (hooks) {
test('it renders', async function (assert) {
assert.expect(1);
await render(hbs`{{app-name}}`);
assert.equal(this.element.textContent.trim(), 'App Name');
assert.strictEqual(this.element.textContent.trim(), 'App Name');
});
});
@@ -10,7 +10,7 @@ module('Integration | Helper | company-copyright', function (hooks) {
assert.expect(1);
const currentYear = new Date().getFullYear();
await render(hbs`{{company-copyright}}`);
assert.equal(
assert.strictEqual(
this.element.textContent.trim(),
`© ${currentYear} Company Name`
);
@@ -9,6 +9,6 @@ module('Integration | Helper | company-name', function (hooks) {
test('it renders', async function (assert) {
assert.expect(1);
await render(hbs`{{company-name}}`);
assert.equal(this.element.textContent.trim(), 'Company Name');
assert.strictEqual(this.element.textContent.trim(), 'Company Name');
});
});
@@ -14,7 +14,7 @@ module('Integration | Helper | doc-url', function (hooks) {
await render(hbs`{{doc-url 'account'}}`);
assert.ok(baseURL);
assert.ok(path);
assert.equal(this.element.textContent.trim(), `${baseURL}${path}`);
assert.strictEqual(this.element.textContent.trim(), `${baseURL}${path}`);
});
test('it throws an error if the specified documentation path cannot be found', async function (assert) {
@@ -11,6 +11,6 @@ module('Integration | Helper | format-date-iso-human', function (hooks) {
await render(hbs`{{format-date-iso-human inputValue}}`);
assert.equal(this.element.textContent.trim(), '2020-01-01 00:00:00');
assert.strictEqual(this.element.textContent.trim(), '2020-01-01 00:00:00');
});
});
@@ -11,6 +11,6 @@ module('Integration | Helper | format-date-iso', function (hooks) {
await render(hbs`{{format-date-iso inputValue}}`);
assert.equal(this.element.textContent.trim(), '2020-01-01T00:00:00.999Z');
assert.strictEqual(this.element.textContent.trim(), '2020-01-01T00:00:00.999Z');
});
});
@@ -32,7 +32,7 @@ module('Unit | Authenticator | password', function (hooks) {
return new Response(200);
});
authenticator.restore(mockData);
assert.equal(applicationAdapter.headers.Authorization, 'Bearer token1234');
assert.strictEqual(applicationAdapter.headers.Authorization, 'Bearer token1234');
});
test('it adds an authorization header to application adapter on authenticate', async function (assert) {
@@ -44,7 +44,7 @@ module('Unit | Authenticator | password', function (hooks) {
this.server.create('auth-method', { id: authMethod.id, scopeId: 'global' });
this.server.create('user', { scopeId: 'global' });
await authenticator.authenticate(creds, null, { scope, authMethod });
assert.equal(
assert.strictEqual(
applicationAdapter.headers.Authorization,
'Bearer thetokenstring'
);
@@ -18,11 +18,11 @@ module('Unit | Service | confirm', function (hooks) {
assert.expect(3);
const service = this.owner.lookup('service:confirm');
service.enabled = true;
assert.equal(service.pending.length, 0, 'No pending confirmations yet');
assert.strictEqual(service.pending.length, 0, 'No pending confirmations yet');
const confirmation = service.confirm();
assert.equal(service.pending.length, 1, 'One pending confirmation created');
assert.strictEqual(service.pending.length, 1, 'One pending confirmation created');
confirmation.confirm();
assert.equal(service.pending.length, 0, 'Confirmation was confirmed');
assert.strictEqual(service.pending.length, 0, 'Confirmation was confirmed');
});
test('confirmations may be confirmed or dismissed', function (assert) {
+4 -4
View File
@@ -83,11 +83,11 @@
"ember-resolver": "^8.0.3",
"ember-source": "~3.28.4",
"ember-template-lint": "^3.7.0",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.9",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-ember": "^10.6.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-qunit": "^6.2.0",
"eslint-plugin-qunit": "^7.3.0",
"jest": "^27.4.7",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
@@ -13,6 +13,6 @@ module('Integration | Component | rose/anonymous', function (hooks) {
{{/rose/anonymous}}
`);
assert.ok(find('main'));
assert.equal(this.element.textContent.trim(), 'template block text');
assert.strictEqual(this.element.textContent.trim(), 'template block text');
});
});
@@ -13,7 +13,7 @@ module('Integration | Component | rose/badge', function (hooks) {
test('it renders with content', async function (assert) {
await render(hbs`<Rose::Badge>host-catalog-1</Rose::Badge>`);
assert.equal(find('.rose-badge').textContent.trim(), 'host-catalog-1');
assert.strictEqual(find('.rose-badge').textContent.trim(), 'host-catalog-1');
});
test('it renders an icon using @icon', async function (assert) {
@@ -8,17 +8,17 @@ module('Integration | Component | rose/button', function (hooks) {
test('it renders', async function (assert) {
await render(hbs`<Rose::Button>Button</Rose::Button>`);
assert.equal(this.element.textContent.trim(), 'Button');
assert.strictEqual(this.element.textContent.trim(), 'Button');
});
test('it is type="button" by default', async function (assert) {
await render(hbs`<Rose::Button>Button</Rose::Button>`);
assert.equal(find('button').type, 'button');
assert.strictEqual(find('button').type, 'button');
});
test('it is type="submit" when @submit={{true}}', async function (assert) {
await render(hbs`<Rose::Button @submit={{true}} />`);
assert.equal(find('button').type, 'submit');
assert.strictEqual(find('button').type, 'submit');
});
test('it is disabled when @disabled={{true}}', async function (assert) {
@@ -17,8 +17,8 @@ module('Integration | Component | rose/card/link', function (hooks) {
test('it renders with @title', async function (assert) {
await render(hbs`<Rose::Card::Link @title="card title" />`);
assert.equal(find('a').title, 'card title');
assert.equal(
assert.strictEqual(find('a').title, 'card title');
assert.strictEqual(
find('.rose-card-link-title').textContent.trim(),
'card title'
);
@@ -26,7 +26,7 @@ module('Integration | Component | rose/card/link', function (hooks) {
test('it renders with @description', async function (assert) {
await render(hbs`<Rose::Card::Link @description="card description" />`);
assert.equal(
assert.strictEqual(
find('.rose-card-link-body').textContent.trim(),
'card description'
);
@@ -34,7 +34,7 @@ module('Integration | Component | rose/card/link', function (hooks) {
test('it renders with @id', async function (assert) {
await render(hbs`<Rose::Card::Link @id="card_id" />`);
assert.equal(
assert.strictEqual(
find('.rose-card-link-footer-id').textContent.trim(),
'card_id'
);
@@ -12,7 +12,7 @@ module('Integration | Component | rose/dialog/body', function (hooks) {
await render(hbs`<Rose::Dialog::Body />`);
assert.equal(this.element.textContent.trim(), '');
assert.strictEqual(this.element.textContent.trim(), '');
// Template block usage:
await render(hbs`
@@ -21,6 +21,6 @@ module('Integration | Component | rose/dialog/body', function (hooks) {
</Rose::Dialog::Body>
`);
assert.equal(this.element.textContent.trim(), 'template block text');
assert.strictEqual(this.element.textContent.trim(), 'template block text');
});
});
@@ -20,12 +20,12 @@ module('Integration | Component | rose/dropdown', function (hooks) {
test('it renders with trigger', async function (assert) {
await render(hbs`<Rose::Dropdown @text="Click me" />`);
assert.equal(find('.rose-dropdown-trigger').textContent.trim(), 'Click me');
assert.strictEqual(find('.rose-dropdown-trigger').textContent.trim(), 'Click me');
});
test('it supports a count', async function (assert) {
await render(hbs`<Rose::Dropdown @text="Click me" @count="2" />`);
assert.equal(find('.rose-badge').textContent.trim(), '2');
assert.strictEqual(find('.rose-badge').textContent.trim(), '2');
});
test('it supports an icon', async function (assert) {
@@ -64,8 +64,8 @@ module('Integration | Component | rose/dropdown', function (hooks) {
<dropdown.button />
</Rose::Dropdown>`);
assert.ok(find('.rose-dropdown-content'));
assert.equal(findAll('a').length, 2);
assert.equal(findAll('button').length, 3);
assert.strictEqual(findAll('a').length, 2);
assert.strictEqual(findAll('button').length, 3);
});
test('it is toggled on click on trigger content', async function (assert) {
@@ -13,12 +13,12 @@ module('Integration | Component | rose/dropdown/button', function (hooks) {
test('it is type="button" by default', async function (assert) {
await render(hbs`<Rose::Dropdown::Button />`);
assert.equal(find('button').type, 'button');
assert.strictEqual(find('button').type, 'button');
});
test('it is type="submit" when @submit={{true}}', async function (assert) {
await render(hbs`<Rose::Dropdown::Button @submit={{true}} />`);
assert.equal(find('button').type, 'submit');
assert.strictEqual(find('button').type, 'submit');
});
test('it is disabled when @disabled={{true}}', async function (assert) {
@@ -14,7 +14,7 @@ module('Integration | Component | rose/dropdown/key-value', function (hooks) {
</Rose::Dropdown::KeyValue>
`);
assert.equal(find('.rose-dropdown-key').textContent.trim(), 'key');
assert.equal(find('.rose-dropdown-value').textContent.trim(), 'value');
assert.strictEqual(find('.rose-dropdown-key').textContent.trim(), 'key');
assert.strictEqual(find('.rose-dropdown-value').textContent.trim(), 'value');
});
});
@@ -21,7 +21,7 @@ module('Integration | Component | rose/dropdown/link', function (hooks) {
await render(hbs`<Rose::Dropdown::Link>
content
</Rose::Dropdown::Link>`);
assert.equal(find('.rose-dropdown-link').textContent.trim(), 'content');
assert.strictEqual(find('.rose-dropdown-link').textContent.trim(), 'content');
});
test('it supports style', async function (assert) {
@@ -13,7 +13,7 @@ module('Integration | Component | rose/dropdown/section', function (hooks) {
</Rose::Dropdown::Section>
`);
assert.ok(find('.rose-dropdown-section'));
assert.equal(this.element.textContent.trim(), 'template block text');
assert.strictEqual(this.element.textContent.trim(), 'template block text');
});
test('it renders with optional @title', async function (assert) {
@@ -22,7 +22,7 @@ module('Integration | Component | rose/dropdown/section', function (hooks) {
template block text
</Rose::Dropdown::Section>
`);
assert.equal(
assert.strictEqual(
find('.rose-dropdown-section-title').textContent.trim(),
'Section Title'
);
@@ -18,6 +18,6 @@ module('Integration | Component | rose/footer/nav', function (hooks) {
<nav.link @href="index"/>
<nav.link @route="about"/>
</Rose::Footer::nav>`);
assert.equal(findAll('a').length, 2);
assert.strictEqual(findAll('a').length, 2);
});
});
@@ -19,6 +19,6 @@ module('Integration | Component | rose/footer/text', function (hooks) {
await render(hbs`<Rose::Footer as |footer|>
<footer.text>content</footer.text>
</Rose::Footer>`);
assert.equal(find('.rose-footer-text').textContent.trim(), 'content');
assert.strictEqual(find('.rose-footer-text').textContent.trim(), 'content');
});
});
@@ -91,23 +91,23 @@ module('Integration | Component | rose/form', function (hooks) {
`);
// Before enabling edit mode, fields are disabled and the edit mode button is displayed
assert.ok(find('.rose-form'));
assert.equal(findAll('input[disabled]').length, 1);
assert.equal(findAll('button').length, 1);
assert.equal(find('button').textContent.trim(), 'Edit');
assert.strictEqual(findAll('input[disabled]').length, 1);
assert.strictEqual(findAll('button').length, 1);
assert.strictEqual(find('button').textContent.trim(), 'Edit');
// After entering edit mode, fields are enabled and save/cancel buttons are displayed
await click('button');
assert.equal(findAll('input[disabled]').length, 0);
assert.equal(findAll('button').length, 2);
assert.equal(find('[type="submit"]').textContent.trim(), 'Save');
assert.equal(
assert.strictEqual(findAll('input[disabled]').length, 0);
assert.strictEqual(findAll('button').length, 2);
assert.strictEqual(find('[type="submit"]').textContent.trim(), 'Save');
assert.strictEqual(
find('button:not([type="submit"])').textContent.trim(),
'Cancel'
);
// After canceling, fields are disabled again and the edit mode button is displayed
await click('button:not([type="submit"])');
assert.equal(findAll('input[disabled]').length, 1);
assert.equal(findAll('button').length, 1);
assert.equal(find('button').textContent.trim(), 'Edit');
assert.strictEqual(findAll('input[disabled]').length, 1);
assert.strictEqual(findAll('button').length, 1);
assert.strictEqual(find('button').textContent.trim(), 'Edit');
});
test('it re-enables read-only mode if the submit handler returns a resolving promise', async function (assert) {
@@ -129,32 +129,32 @@ module('Integration | Component | rose/form', function (hooks) {
`);
// Before enabling edit mode, fields are disabled and the edit mode button is displayed
assert.ok(find('.rose-form'));
assert.equal(findAll('input[disabled]').length, 1);
assert.equal(findAll('button').length, 1);
assert.equal(find('button').textContent.trim(), 'Edit');
assert.strictEqual(findAll('input[disabled]').length, 1);
assert.strictEqual(findAll('button').length, 1);
assert.strictEqual(find('button').textContent.trim(), 'Edit');
// After entering edit mode, fields are enabled and save/cancel buttons are displayed
await click('button');
assert.equal(findAll('input[disabled]').length, 0);
assert.equal(findAll('button').length, 2);
assert.equal(find('[type="submit"]').textContent.trim(), 'Save');
assert.equal(
assert.strictEqual(findAll('input[disabled]').length, 0);
assert.strictEqual(findAll('button').length, 2);
assert.strictEqual(find('[type="submit"]').textContent.trim(), 'Save');
assert.strictEqual(
find('button:not([type="submit"])').textContent.trim(),
'Cancel'
);
// After saving with failure, fields are enabled and save/cancel buttons are displayed
this.submit = () => reject();
assert.equal(findAll('input[disabled]').length, 0);
assert.equal(findAll('button').length, 2);
assert.equal(find('[type="submit"]').textContent.trim(), 'Save');
assert.equal(
assert.strictEqual(findAll('input[disabled]').length, 0);
assert.strictEqual(findAll('button').length, 2);
assert.strictEqual(find('[type="submit"]').textContent.trim(), 'Save');
assert.strictEqual(
find('button:not([type="submit"])').textContent.trim(),
'Cancel'
);
// After saving with success, fields are disabled again and the edit mode button is displayed
this.submit = () => resolve();
await click('button[type="submit"]');
assert.equal(findAll('input[disabled]').length, 1);
assert.equal(findAll('button').length, 1);
assert.equal(find('button').textContent.trim(), 'Edit');
assert.strictEqual(findAll('input[disabled]').length, 1);
assert.strictEqual(findAll('button').length, 1);
assert.strictEqual(find('button').textContent.trim(), 'Edit');
});
});
@@ -9,7 +9,7 @@ module('Integration | Component | rose/form/checkbox', function (hooks) {
test('it renders', async function (assert) {
assert.expect(3);
await render(hbs`<Rose::Form::Checkbox @label="Label" />`);
assert.equal(find('label').textContent.trim(), 'Label');
assert.strictEqual(find('label').textContent.trim(), 'Label');
assert.ok(find('input'));
assert.notOk(find('.rose-form-checkbox-label-description'));
});
@@ -19,11 +19,11 @@ module('Integration | Component | rose/form/checkbox', function (hooks) {
await render(
hbs`<Rose::Form::Checkbox @label="Label" @description="Hello world" />`
);
assert.equal(
assert.strictEqual(
find('.rose-form-checkbox-label-text').textContent.trim(),
'Label'
);
assert.equal(
assert.strictEqual(
find('.rose-form-checkbox-label-description').textContent.trim(),
'Hello world'
);
@@ -35,7 +35,7 @@ module('Integration | Component | rose/form/checkbox', function (hooks) {
await render(
hbs`<Rose::Form::Checkbox @label="Label" @helperText="Hello world" />`
);
assert.equal(
assert.strictEqual(
find('.rose-form-helper-text').textContent.trim(),
'Hello world'
);
@@ -53,9 +53,9 @@ module('Integration | Component | rose/form/checkbox', function (hooks) {
const id = fieldEl.id;
const errorsId = `errors-${id}`;
const errorMessageEl = find('.rose-form-errors');
assert.equal(errorMessageEl.id, errorsId);
assert.equal(errorMessageEl.textContent.trim(), 'An error occurred.');
assert.equal(fieldEl.getAttribute('aria-describedby').trim(), errorsId);
assert.strictEqual(errorMessageEl.id, errorsId);
assert.strictEqual(errorMessageEl.textContent.trim(), 'An error occurred.');
assert.strictEqual(fieldEl.getAttribute('aria-describedby').trim(), errorsId);
});
test('it is not checked by default', async function (assert) {
@@ -31,7 +31,7 @@ module('Integration | Component | rose/form/checkbox/group', function (hooks) {
value={{group.item.id}} />
</Rose::Form::Checkbox::Group>
`);
assert.equal(findAll('input').length, 3);
assert.strictEqual(findAll('input').length, 3);
});
test('it checks checkboxes for items present in a selectedItems array', async function (assert) {
@@ -49,7 +49,7 @@ module('Integration | Component | rose/form/checkbox/group', function (hooks) {
value={{group.item.id}} />
</Rose::Form::Checkbox::Group>
`);
assert.equal(findAll(':checked').length, 1);
assert.strictEqual(findAll(':checked').length, 1);
});
test('it fires onChange when items are checked, passing an array of selected items', async function (assert) {
@@ -57,8 +57,8 @@ module('Integration | Component | rose/form/checkbox/group', function (hooks) {
this.items = items;
this.selectedItems = selectedItems;
this.onChange = (newlySelectedItems) => {
assert.equal(selectedItems.length, 1);
assert.equal(newlySelectedItems.length, 2);
assert.strictEqual(selectedItems.length, 1);
assert.strictEqual(newlySelectedItems.length, 2);
};
await render(hbs`
<Rose::Form::Checkbox::Group
@@ -80,8 +80,8 @@ module('Integration | Component | rose/form/checkbox/group', function (hooks) {
this.items = items;
this.selectedItems = selectedItems;
this.onChange = (newlySelectedItems) => {
assert.equal(selectedItems.length, 1);
assert.equal(newlySelectedItems.length, 0);
assert.strictEqual(selectedItems.length, 1);
assert.strictEqual(newlySelectedItems.length, 0);
};
await render(hbs`
<Rose::Form::Checkbox::Group
@@ -15,11 +15,11 @@ module('Integration | Component | rose/form/errors', function (hooks) {
<//Rose::Form::Errors>
`);
assert.ok(find('.rose-form-errors'));
assert.equal(
assert.strictEqual(
find('.rose-form-error-message:first-child').textContent.trim(),
'An error occurred.'
);
assert.equal(
assert.strictEqual(
find('.rose-form-error-message:last-child').textContent.trim(),
'Another error occurred.'
);
@@ -12,6 +12,6 @@ module('Integration | Component | rose/form/errors/message', function (hooks) {
An error occurred.
</Rose::Form::Errors::Message>
`);
assert.equal(this.element.textContent.trim(), 'An error occurred.');
assert.strictEqual(this.element.textContent.trim(), 'An error occurred.');
});
});
@@ -35,15 +35,15 @@ module('Integration | Component | rose/form/fieldset', function (hooks) {
assert.expect(4);
await renderComponent(false);
assert.ok(find('.rose-form-fieldset'));
assert.equal(
assert.strictEqual(
find('.rose-form-fieldset-title').textContent.trim(),
this.mockTitle
);
assert.equal(
assert.strictEqual(
find('.rose-form-fieldset-description').textContent.trim(),
this.mockDescription
);
assert.equal(
assert.strictEqual(
find('.rose-form-fieldset-body').textContent.trim(),
this.mockBody
);
@@ -53,12 +53,12 @@ module('Integration | Component | rose/form/fieldset', function (hooks) {
assert.expect(4);
await renderComponent(true);
assert.ok(find('.rose-form-fieldset'));
assert.equal(
assert.strictEqual(
find('.rose-form-fieldset-title').textContent.trim(),
this.mockTitle
);
assert.notOk(find('.rose-form-fieldset-description'));
assert.equal(
assert.strictEqual(
find('.rose-form-fieldset-body').textContent.trim(),
this.mockBody
);
@@ -70,7 +70,7 @@ module('Integration | Component | rose/form/fieldset', function (hooks) {
const descriptionElement = find('.rose-form-fieldset-description');
const fieldsetElement = find('.rose-form-fieldset');
assert.equal(
assert.strictEqual(
fieldsetElement.getAttribute('aria-describedby'),
descriptionElement.id,
'Fieldset is described by description'
@@ -14,7 +14,7 @@ module('Integration | Component | rose/form/helper-text', function (hooks) {
</Rose::Form::HelperText>
`);
assert.ok(find('.rose-form-helper-text'));
assert.equal(
assert.strictEqual(
find('.rose-form-helper-text').textContent.trim(),
'Helper text'
);
@@ -8,8 +8,8 @@ module('Integration | Component | rose/form/input', function (hooks) {
test('it renders', async function (assert) {
await render(hbs`<Rose::Form::Input @value="Text" @label="Label" />`);
assert.equal(await find('label').textContent.trim(), 'Label');
assert.equal(await find('input').value, 'Text');
assert.strictEqual(await find('label').textContent.trim(), 'Label');
assert.strictEqual(await find('input').value, 'Text');
});
test('it displays optional helper text', async function (assert) {
@@ -18,9 +18,9 @@ module('Integration | Component | rose/form/input', function (hooks) {
const id = fieldEl.id;
const helperId = `helper-text-${id}`;
const helperTextEl = find('.rose-form-helper-text');
assert.equal(helperTextEl.textContent.trim(), 'Help me');
assert.equal(helperTextEl.id, helperId);
assert.equal(fieldEl.getAttribute('aria-describedby').trim(), helperId);
assert.strictEqual(helperTextEl.textContent.trim(), 'Help me');
assert.strictEqual(helperTextEl.id, helperId);
assert.strictEqual(fieldEl.getAttribute('aria-describedby').trim(), helperId);
});
test('it displays optional errors', async function (assert) {
@@ -35,9 +35,9 @@ module('Integration | Component | rose/form/input', function (hooks) {
const id = fieldEl.id;
const errorsId = `errors-${id}`;
const errorMessageEl = find('.rose-form-errors');
assert.equal(errorMessageEl.id, errorsId);
assert.equal(errorMessageEl.textContent.trim(), 'An error occurred.');
assert.equal(
assert.strictEqual(errorMessageEl.id, errorsId);
assert.strictEqual(errorMessageEl.textContent.trim(), 'An error occurred.');
assert.strictEqual(
fieldEl.getAttribute('aria-describedby').split(' ')[1],
errorsId
);
@@ -45,12 +45,12 @@ module('Integration | Component | rose/form/input', function (hooks) {
test('it is type="text" by default', async function (assert) {
await render(hbs`<Rose::Form::Input />`);
assert.equal(await find('input').type, 'text');
assert.strictEqual(await find('input').type, 'text');
});
test('it supports a @type attribute', async function (assert) {
await render(hbs`<Rose::Form::Input @type="password" />`);
assert.equal(await find('input').type, 'password');
assert.strictEqual(await find('input').type, 'password');
});
test('it supports disabled attribute', async function (assert) {
@@ -14,6 +14,6 @@ module('Integration | Component | rose/form/label', function (hooks) {
<//Rose::Form::Label>
`);
assert.ok(find('.rose-form-label'));
assert.equal(find('.rose-form-label').textContent.trim(), 'Form Label');
assert.strictEqual(find('.rose-form-label').textContent.trim(), 'Form Label');
});
});
@@ -9,7 +9,7 @@ module('Integration | Component | rose/form/radio/card', function (hooks) {
test('it renders', async function (assert) {
await render(hbs`<Rose::Form::Radio::Card />`);
assert.ok(await find('input'));
assert.equal(await find('input').type, 'radio');
assert.strictEqual(await find('input').type, 'radio');
});
test('it renders in a tile format when tile layout is applied', async function (assert) {
@@ -22,9 +22,9 @@ module('Integration | Component | rose/form/radio/group', function (hooks) {
</Rose::Form::Radio::Group>
`);
assert.equal(findAll('input').length, 2);
assert.equal(findAll('input')[0].name, 'bird');
assert.equal(findAll('input')[1].name, 'bird');
assert.strictEqual(findAll('input').length, 2);
assert.strictEqual(findAll('input')[0].name, 'bird');
assert.strictEqual(findAll('input')[1].name, 'bird');
});
test('it renders with @selectedValue value selected', async function (assert) {
@@ -80,10 +80,10 @@ module('Integration | Component | rose/form/radio/group', function (hooks) {
assert.notOk(this.selectedValue);
await click(findAll('[type="radio"]')[0]);
assert.equal(this.selectedValue, 'pegion');
assert.strictEqual(this.selectedValue, 'pegion');
await click(findAll('[type="radio"]')[1]);
assert.equal(this.selectedValue, 'flamingo');
assert.strictEqual(this.selectedValue, 'flamingo');
});
test('it uses @selectedValue value to set active radiofield', async function (assert) {
@@ -9,12 +9,12 @@ module('Integration | Component | rose/form/radio/radio', function (hooks) {
test('it renders', async function (assert) {
await render(hbs`<Rose::Form::Radio::Radio />`);
assert.ok(await find('input'));
assert.equal(await find('input').type, 'radio');
assert.strictEqual(await find('input').type, 'radio');
});
test('it renders with label', async function (assert) {
await render(hbs`<Rose::Form::Radio::Radio @label="Label"/>`);
assert.equal(await find('label').textContent.trim(), 'Label');
assert.strictEqual(await find('label').textContent.trim(), 'Label');
});
test('it supports an icon', async function (assert) {
@@ -22,9 +22,9 @@ module('Integration | Component | rose/form/select', function (hooks) {
</field.field>
</Rose::Form::Select>
`);
assert.equal(find('label').textContent.trim(), 'Label');
assert.strictEqual(find('label').textContent.trim(), 'Label');
assert.ok(find('select'));
assert.equal(findAll('option').length, 4);
assert.strictEqual(findAll('option').length, 4);
});
test('it displays optional helper text', async function (assert) {
@@ -45,9 +45,9 @@ module('Integration | Component | rose/form/select', function (hooks) {
const id = fieldEl.id;
const helperId = `helper-text-${id}`;
const helperTextEl = find('.rose-form-helper-text');
assert.equal(helperTextEl.textContent.trim(), 'Help me');
assert.equal(helperTextEl.id, helperId);
assert.equal(fieldEl.getAttribute('aria-describedby').trim(), helperId);
assert.strictEqual(helperTextEl.textContent.trim(), 'Help me');
assert.strictEqual(helperTextEl.id, helperId);
assert.strictEqual(fieldEl.getAttribute('aria-describedby').trim(), helperId);
});
test('it displays optional errors', async function (assert) {
@@ -72,9 +72,9 @@ module('Integration | Component | rose/form/select', function (hooks) {
const id = fieldEl.id;
const errorsId = `errors-${id}`;
const errorMessageEl = find('.rose-form-errors');
assert.equal(errorMessageEl.id, errorsId);
assert.equal(errorMessageEl.textContent.trim(), 'An error occurred.');
assert.equal(
assert.strictEqual(errorMessageEl.id, errorsId);
assert.strictEqual(errorMessageEl.textContent.trim(), 'An error occurred.');
assert.strictEqual(
fieldEl.getAttribute('aria-describedby').split(' ')[1],
errorsId
);
@@ -111,15 +111,15 @@ module('Integration | Component | rose/form/select', function (hooks) {
</field.field>
</Rose::Form::Select>
`);
assert.equal(find('select').value, 'value-1');
assert.strictEqual(find('select').value, 'value-1');
this.set('value', 'value-2');
assert.equal(find('select').value, 'value-2');
assert.strictEqual(find('select').value, 'value-2');
});
test('it triggers an action on change', async function (assert) {
assert.expect(2);
this.onChange1 = (value) => {
assert.equal(
assert.strictEqual(
value,
null,
'On initial render, onChange is triggered with null'
@@ -127,7 +127,7 @@ module('Integration | Component | rose/form/select', function (hooks) {
this.set('onChange', this.onChange2);
};
this.onChange2 = (value) => {
assert.equal(value, 'value-1', 'On change, value is passed in.');
assert.strictEqual(value, 'value-1', 'On change, value is passed in.');
};
this.onChange = this.onChange1;
await render(hbs`
@@ -8,8 +8,8 @@ module('Integration | Component | rose/form/textarea', function (hooks) {
test('it renders', async function (assert) {
await render(hbs`<Rose::Form::Textarea @value="Text" @label="Label" />`);
assert.equal(await find('label').textContent.trim(), 'Label');
assert.equal(await find('textarea').value, 'Text');
assert.strictEqual(await find('label').textContent.trim(), 'Label');
assert.strictEqual(await find('textarea').value, 'Text');
});
test('it displays optional helper text', async function (assert) {
@@ -18,9 +18,9 @@ module('Integration | Component | rose/form/textarea', function (hooks) {
const id = fieldEl.id;
const helperId = `helper-text-${id}`;
const helperTextEl = find('.rose-form-helper-text');
assert.equal(helperTextEl.textContent.trim(), 'Help me');
assert.equal(helperTextEl.id, helperId);
assert.equal(fieldEl.getAttribute('aria-describedby').trim(), helperId);
assert.strictEqual(helperTextEl.textContent.trim(), 'Help me');
assert.strictEqual(helperTextEl.id, helperId);
assert.strictEqual(fieldEl.getAttribute('aria-describedby').trim(), helperId);
});
test('it displays optional errors', async function (assert) {
@@ -35,9 +35,9 @@ module('Integration | Component | rose/form/textarea', function (hooks) {
const id = fieldEl.id;
const errorsId = `errors-${id}`;
const errorMessageEl = find('.rose-form-errors');
assert.equal(errorMessageEl.id, errorsId);
assert.equal(errorMessageEl.textContent.trim(), 'An error occurred.');
assert.equal(
assert.strictEqual(errorMessageEl.id, errorsId);
assert.strictEqual(errorMessageEl.textContent.trim(), 'An error occurred.');
assert.strictEqual(
fieldEl.getAttribute('aria-describedby').split(' ')[1],
errorsId
);
@@ -13,7 +13,7 @@ module('Integration | Component | rose/header/brand', function (hooks) {
`);
assert.ok(find('.rose-header-brand'));
assert.ok(find('.rose-header-brand svg'));
assert.equal(
assert.strictEqual(
find('.rose-header-brand-text').textContent.trim(),
'Product Name'
);
@@ -16,7 +16,7 @@ module('Integration | Component | rose/header/nav', function (hooks) {
<nav.link @route="index"/>
<nav.link @route="about"/>
</Rose::Header::nav>`);
assert.equal(findAll('a').length, 2);
assert.strictEqual(findAll('a').length, 2);
});
test('it renders nav dropdown elements', async function (assert) {
@@ -24,6 +24,6 @@ module('Integration | Component | rose/header/nav', function (hooks) {
<nav.dropdown />
<nav.dropdown />
</Rose::Header::nav>`);
assert.equal(findAll('.rose-dropdown').length, 2);
assert.strictEqual(findAll('.rose-dropdown').length, 2);
});
});
@@ -16,7 +16,7 @@ module('Integration | Component | rose/header/utilities', function (hooks) {
<nav.dropdown />
<nav.dropdown />
</Rose::Header::Utilities>`);
assert.equal(findAll('.rose-dropdown').length, 2);
assert.strictEqual(findAll('.rose-dropdown').length, 2);
});
test('it renders nav dropdown elements as right aligned', async function (assert) {
@@ -22,7 +22,7 @@ module('Integration | Component | rose/layout/centered', function (hooks) {
await render(hbs`<Rose::Layout::Centered>
Layout content
</Rose::Layout::Centered>`);
assert.equal(
assert.strictEqual(
find('.rose-layout-centered').textContent.trim(),
'Layout content'
);
@@ -23,7 +23,7 @@ module('Integration | Component | rose/list/key-value', function (hooks) {
const itemLabelledBy = find(
'.rose-list-key-value-item:first-child'
).getAttribute('aria-labelledby');
assert.equal(
assert.strictEqual(
findAll('.rose-list-key-value-item').length,
2,
'it has two items'
@@ -15,12 +15,12 @@ module('Integration | Component | rose/message', function (hooks) {
</Rose::Message>
`);
assert.ok(find('.rose-message'));
assert.equal(find('.rose-message-title').textContent.trim(), 'Title');
assert.equal(find('.rose-message-subtitle').textContent.trim(), 'Subtitle');
assert.equal(
assert.strictEqual(find('.rose-message-title').textContent.trim(), 'Title');
assert.strictEqual(find('.rose-message-subtitle').textContent.trim(), 'Subtitle');
assert.strictEqual(
find('.rose-message-description').textContent.trim(),
'Description'
);
assert.equal(find('.rose-message-link').textContent.trim(), 'Link');
assert.strictEqual(find('.rose-message-link').textContent.trim(), 'Link');
});
});
@@ -21,6 +21,6 @@ module('Integration | Component | rose/nav/breadcrumbs', function (hooks) {
<breadcrumbs.link @route="index" />
<breadcrumbs.link @route="index" />
</Rose::Nav::Breadcrumbs>`);
assert.equal(findAll('.rose-nav-link').length, 2);
assert.strictEqual(findAll('.rose-nav-link').length, 2);
});
});
@@ -13,6 +13,6 @@ module('Integration | Component | rose/nav/link', function (hooks) {
Item Name
</Rose::Nav::Link>
`);
assert.equal(find('.rose-nav-link').textContent.trim(), 'Item Name');
assert.strictEqual(find('.rose-nav-link').textContent.trim(), 'Item Name');
});
});
@@ -13,8 +13,8 @@ module('Integration | Component | rose/nav/sidebar', function (hooks) {
<nav.link @route="index">Item Name</nav.link>
</Rose::Nav::Sidebar>
`);
assert.equal(find('.rose-nav-title').textContent.trim(), 'Title');
assert.equal(find('.rose-nav-link').textContent.trim(), 'Item Name');
assert.strictEqual(find('.rose-nav-title').textContent.trim(), 'Title');
assert.strictEqual(find('.rose-nav-link').textContent.trim(), 'Item Name');
});
test('it associates title with nav via aria-labelledby', async function (assert) {
@@ -27,7 +27,7 @@ module('Integration | Component | rose/nav/sidebar', function (hooks) {
const el = find('.rose-nav-sidebar');
const id = el.id;
const titleId = `title-${id}`;
assert.equal(find('.rose-nav-title').id, titleId);
assert.equal(el.getAttribute('aria-labelledby').trim(), titleId);
assert.strictEqual(find('.rose-nav-title').id, titleId);
assert.strictEqual(el.getAttribute('aria-labelledby').trim(), titleId);
});
});
@@ -14,6 +14,6 @@ module('Integration | Component | rose/nav/tabs', function (hooks) {
</Rose::Nav::Tabs>
`);
assert.ok(find('.rose-nav-tabs'));
assert.equal(find('.rose-nav-link').textContent.trim(), 'Item Name');
assert.strictEqual(find('.rose-nav-link').textContent.trim(), 'Item Name');
});
});
@@ -16,7 +16,7 @@ module('Integration | Component | rose/notification', function (hooks) {
</Rose::Notification>
`);
assert.ok(find('.rose-notification'));
assert.equal(
assert.strictEqual(
find('.rose-notification-body').textContent.trim(),
'An error occurred.'
);
@@ -20,7 +20,7 @@ module('Integration | Component | rose/table', function (hooks) {
test('it renders with caption', async function (assert) {
await render(hbs`<Rose::Table @caption="table caption"/>`);
assert.ok(find('caption'));
assert.equal(find('caption').textContent.trim(), 'table caption');
assert.strictEqual(find('caption').textContent.trim(), 'table caption');
});
test('it renders with header', async function (assert) {
@@ -12,7 +12,7 @@ module('Integration | Component | rose/table/row/cell', function (hooks) {
content
</Rose::Table::Row::Cell>`);
assert.ok(find('td'));
assert.equal(find('.rose-table-cell').textContent.trim(), 'content');
assert.strictEqual(find('.rose-table-cell').textContent.trim(), 'content');
});
test('it renders with attributes', async function (assert) {
@@ -10,7 +10,7 @@ module('Integration | Modifier | on-click-inside', function (hooks) {
assert.expect(2);
this.set('clickedInside', (element) => {
assert.ok(element);
assert.equal(element.id, 'inside');
assert.strictEqual(element.id, 'inside');
});
await render(hbs`
<div id="outside"></div>
@@ -10,7 +10,7 @@ module('Integration | Modifier | on-click-outside', function (hooks) {
assert.expect(2);
this.set('clickedOutside', (element, event) => {
assert.ok(element);
assert.equal(event.target.id, 'outside');
assert.strictEqual(event.target.id, 'outside');
});
await render(hbs`<div id="outside"></div>
+4 -4
View File
@@ -78,11 +78,11 @@
"ember-source": "~3.28.4",
"ember-template-lint": "^3.12.0",
"ember-template-lint-plugin-prettier": "^2.0.0",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.9",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-ember": "^10.6.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-qunit": "^6.2.0",
"eslint-plugin-qunit": "^7.3.0",
"faker": "^5.5.3",
"js-bexpr": "hashicorp/js-bexpr#9b4a4b54d85eba67fdfc0990133d1518d890b1e1",
"loader.js": "^4.7.0",
@@ -51,7 +51,7 @@ module('Acceptance | accounts | change password', function (hooks) {
assert.expect(1);
await visit(urls.changePassword);
await a11yAudit();
assert.equal(currentURL(), urls.changePassword);
assert.strictEqual(currentURL(), urls.changePassword);
});
test('visiting account change password from header', async function (assert) {
@@ -63,7 +63,7 @@ module('Acceptance | accounts | change password', function (hooks) {
await click(
'.rose-header-utilities .rose-dropdown .rose-dropdown-content a'
);
assert.equal(currentURL(), urls.changePassword);
assert.strictEqual(currentURL(), urls.changePassword);
});
test('can change password for account', async function (assert) {
@@ -72,12 +72,12 @@ module('Acceptance | accounts | change password', function (hooks) {
'/accounts/:idMethod',
(_, { params: { idMethod }, requestBody }) => {
const attrs = JSON.parse(requestBody);
assert.equal(
assert.strictEqual(
attrs.current_password,
'current password',
'current password is provided'
);
assert.equal(
assert.strictEqual(
attrs.new_password,
'new password',
'new password is provided'
@@ -65,7 +65,7 @@ module('Acceptance | accounts | create', function (hooks) {
assert.expect(1);
await visit(urls.accounts);
await a11yAudit();
assert.equal(currentURL(), urls.accounts);
assert.strictEqual(currentURL(), urls.accounts);
});
test('can create a new account', async function (assert) {
@@ -77,7 +77,7 @@ module('Acceptance | accounts | create', function (hooks) {
await fillIn('[name="login_name"]', 'username');
await fillIn('[name="password"]', 'password');
await click('form [type="submit"]:not(:disabled)');
assert.equal(this.server.db.accounts.length, accountsCount + 1);
assert.strictEqual(this.server.db.accounts.length, accountsCount + 1);
});
test('Users cannot create a new account without proper authorization', async function (assert) {
@@ -121,8 +121,8 @@ module('Acceptance | accounts | create', function (hooks) {
await visit(urls.newAccount);
await fillIn('[name="name"]', 'Account name');
await click('form button:not([type="submit"])');
assert.equal(this.server.db.accounts.length, accountsCount);
assert.equal(currentURL(), urls.accounts);
assert.strictEqual(this.server.db.accounts.length, accountsCount);
assert.strictEqual(currentURL(), urls.accounts);
});
test('saving a new account with invalid fields displays error messages', async function (assert) {
@@ -150,12 +150,12 @@ module('Acceptance | accounts | create', function (hooks) {
await fillIn('[name="name"]', 'new account');
await click('form [type="submit"]');
await a11yAudit();
assert.equal(
assert.strictEqual(
find('.rose-notification-body').textContent.trim(),
'The request was invalid.',
'Displays primary error message.'
);
assert.equal(
assert.strictEqual(
find('.rose-form-error-message').textContent.trim(),
'Name is required.',
'Displays field-level errors.'
@@ -64,7 +64,7 @@ module('Acceptance | accounts | delete', function (hooks) {
const accountsCount = this.server.db.accounts.length;
await visit(urls.account);
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
assert.equal(this.server.db.accounts.length, accountsCount - 1);
assert.strictEqual(this.server.db.accounts.length, accountsCount - 1);
});
test('cannot delete an account without proper authorization', async function (assert) {
@@ -93,7 +93,7 @@ module('Acceptance | accounts | delete', function (hooks) {
await visit(urls.account);
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
await a11yAudit();
assert.equal(
assert.strictEqual(
find('.rose-notification-body').textContent.trim(),
'Oops.',
'Displays primary error message.'
@@ -63,7 +63,7 @@ module('Acceptance | accounts | read', function (hooks) {
await visit(urls.accounts);
await click('main tbody .rose-table-header-cell:nth-child(1) a');
await a11yAudit();
assert.equal(currentURL(), urls.account);
assert.strictEqual(currentURL(), urls.account);
});
test('cannot navigate to an account form without proper authorization', async function (assert) {
@@ -57,7 +57,7 @@ module('Acceptance | accounts | set password', function (hooks) {
assert.expect(1);
await visit(urls.setPassword);
await a11yAudit();
assert.equal(currentURL(), urls.setPassword);
assert.strictEqual(currentURL(), urls.setPassword);
});
test('can navigate to route with proper authorization', async function (assert) {
@@ -86,7 +86,7 @@ module('Acceptance | accounts | set password', function (hooks) {
'/accounts/:idMethod',
(_, { params: { idMethod }, requestBody }) => {
const attrs = JSON.parse(requestBody);
assert.equal(attrs.password, 'update password', 'new password is set');
assert.strictEqual(attrs.password, 'update password', 'new password is set');
const id = idMethod.split(':')[0];
return { id };
}
@@ -65,7 +65,7 @@ module('Acceptance | accounts | update', function (hooks) {
await click('form [type="button"]', 'Activate edit mode');
await fillIn('[name="name"]', 'update name');
await click('form [type="submit"]:not(:disabled)');
assert.equal(this.server.db.accounts[0].name, 'update name');
assert.strictEqual(this.server.db.accounts[0].name, 'update name');
});
test('cannot update resource without proper authorization', async function (assert) {
@@ -103,7 +103,7 @@ module('Acceptance | accounts | update', function (hooks) {
await fillIn('[name="name"]', 'save account');
await click('form [type="submit"]');
await a11yAudit();
assert.equal(
assert.strictEqual(
find('.rose-notification-body').textContent.trim(),
'Oops.',
'Displays primary error message.'
@@ -136,12 +136,12 @@ module('Acceptance | accounts | update', function (hooks) {
await fillIn('[name="name"]', 'existing account');
await click('form [type="submit"]');
await a11yAudit();
assert.equal(
assert.strictEqual(
find('.rose-notification-body').textContent.trim(),
'The request was invalid.',
'Displays primary error message.'
);
assert.equal(
assert.strictEqual(
find('.rose-form-error-message').textContent.trim(),
'Name is required.',
'Displays field-level errors.'
@@ -66,7 +66,7 @@ module('Acceptance | auth-methods | create ', function (hooks) {
await fillIn('[name="name"]', 'AuthMethod name');
await fillIn('[name="description"]', 'description');
await click('form [type="submit"]:not(:disabled)');
assert.equal(this.server.db.authMethods.length, authMethodsCount + 1);
assert.strictEqual(this.server.db.authMethods.length, authMethodsCount + 1);
});
test('Users can navigate to new auth-methods route with proper authorization', async function (assert) {
@@ -103,8 +103,8 @@ module('Acceptance | auth-methods | create ', function (hooks) {
await fillIn('[name="name"]', 'AuthMethod name');
await fillIn('[name="description"]', 'description');
await click('form button:not([type="submit"])');
assert.equal(this.server.db.authMethods.length, authMethodsCount);
assert.equal(currentURL(), urls.authMethods);
assert.strictEqual(this.server.db.authMethods.length, authMethodsCount);
assert.strictEqual(currentURL(), urls.authMethods);
});
test('user can make primary an auth method', async function (assert) {
@@ -119,7 +119,7 @@ module('Acceptance | auth-methods | create ', function (hooks) {
'.rose-layout-page-actions .rose-dropdown-content [type="button"]:first-child'
);
const scope = this.server.schema.scopes.find(instances.orgScope.id);
assert.equal(
assert.strictEqual(
scope.primaryAuthMethodId,
instances.authMethod.id,
'Primary auth method is set.'
@@ -209,7 +209,7 @@ module('Acceptance | auth-methods | create ', function (hooks) {
'.rose-table-body .rose-table-row:first-child .rose-dropdown-content [type="button"]:first-child'
);
let scope = this.server.schema.scopes.find(instances.orgScope.id);
assert.equal(
assert.strictEqual(
scope.primaryAuthMethodId,
instances.authMethod.id,
'Primary auth method is set.'
@@ -53,7 +53,7 @@ module('Acceptance | auth methods | delete', function (hooks) {
const authMethodsCount = this.server.db.authMethods.length;
await visit(urls.authMethod);
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
assert.equal(this.server.db.authMethods.length, authMethodsCount - 1);
assert.strictEqual(this.server.db.authMethods.length, authMethodsCount - 1);
});
test('errors are displayed when delete on an auth method fails', async function (assert) {
@@ -72,7 +72,7 @@ module('Acceptance | auth methods | delete', function (hooks) {
await visit(urls.authMethod);
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
await a11yAudit();
assert.equal(
assert.strictEqual(
find('.rose-notification-body').textContent.trim(),
'Oops.',
'Displays primary error message.'
@@ -56,14 +56,14 @@ module('Acceptance | auth methods | oidc', function (hooks) {
assert.expect(1);
await visit(urls.authMethod);
await a11yAudit();
assert.equal(currentURL(), urls.authMethod);
assert.strictEqual(currentURL(), urls.authMethod);
});
test('can view oidc state', async function (assert) {
assert.expect(1);
await visit(urls.authMethod);
await click('.rose-layout-page-actions .rose-dropdown-trigger');
assert.equal(
assert.strictEqual(
find('.rose-dropdown[open] input:checked').value,
instances.authMethod.attributes.state
);
@@ -76,7 +76,7 @@ module('Acceptance | auth methods | oidc', function (hooks) {
await click('.rose-layout-page-actions .rose-dropdown-trigger');
await click(`.rose-dropdown[open] input[value="${updateValue}"]`);
const authMethod = this.server.db.authMethods.find(instances.authMethod.id);
assert.equal(authMethod.attributes.state, updateValue);
assert.strictEqual(authMethod.attributes.state, updateValue);
});
test('can update oidc state to active-private', async function (assert) {
@@ -86,7 +86,7 @@ module('Acceptance | auth methods | oidc', function (hooks) {
await click('.rose-layout-page-actions .rose-dropdown-trigger');
await click(`.rose-dropdown[open] input[value="${updateValue}"]`);
const authMethod = this.server.db.authMethods.find(instances.authMethod.id);
assert.equal(authMethod.attributes.state, updateValue);
assert.strictEqual(authMethod.attributes.state, updateValue);
});
test('can update oidc state to active-public', async function (assert) {
@@ -98,7 +98,7 @@ module('Acceptance | auth methods | oidc', function (hooks) {
await click('.rose-layout-page-actions .rose-dropdown-trigger');
await click(`.rose-dropdown[open] input[value="${updateValue}"]`);
const authMethod = this.server.db.authMethods.find(instances.authMethod.id);
assert.equal(authMethod.attributes.state, updateValue);
assert.strictEqual(authMethod.attributes.state, updateValue);
});
// FIXME: How to mock just one request routed to /auth-methods and let everything else passthrough?
@@ -51,7 +51,7 @@ module('Acceptance | auth methods | read', function (hooks) {
assert.expect(1);
await visit(urls.authMethods);
await a11yAudit();
assert.equal(currentURL(), urls.authMethods);
assert.strictEqual(currentURL(), urls.authMethods);
});
test('can navigate to an auth method form', async function (assert) {
@@ -59,7 +59,7 @@ module('Acceptance | auth methods | read', function (hooks) {
await visit(urls.authMethods);
await click('main tbody .rose-table-header-cell:nth-child(1) a');
await a11yAudit();
assert.equal(currentURL(), urls.authMethod);
assert.strictEqual(currentURL(), urls.authMethod);
});
test('cannot navigate to an auth method form without proper authorization', async function (assert) {
@@ -54,7 +54,7 @@ module('Acceptance | auth methods | update', function (hooks) {
await click('form [type="button"]', 'Activate edit mode');
await fillIn('[name="name"]', 'update name');
await click('form [type="submit"]:not(:disabled)');
assert.equal(this.server.db.authMethods[0].name, 'update name');
assert.strictEqual(this.server.db.authMethods[0].name, 'update name');
});
test('can update an auth method and cancel changes', async function (assert) {
@@ -102,12 +102,12 @@ module('Acceptance | auth methods | update', function (hooks) {
await fillIn('[name="name"]', 'existing auth method');
await click('form [type="submit"]');
await a11yAudit();
assert.equal(
assert.strictEqual(
find('.rose-notification-body').textContent.trim(),
'The request was invalid.',
'Displays primary error message.'
);
assert.equal(
assert.strictEqual(
find('.rose-form-error-message').textContent.trim(),
'Name is required.',
'Displays field-level errors.'
@@ -110,7 +110,7 @@ module('Acceptance | authentication', function (hooks) {
assert.expect(1);
await visit(authenticateURL);
await a11yAudit();
assert.equal(currentURL(), authMethodAuthenticateURL);
assert.strictEqual(currentURL(), authMethodAuthenticateURL);
});
test('visiting auth methods authenticate route when there no methods shows a message', async function (assert) {
@@ -119,7 +119,7 @@ module('Acceptance | authentication', function (hooks) {
authMethodOIDC.destroy();
await visit(authenticateURL);
await a11yAudit();
assert.equal(currentURL(), authenticateURL);
assert.strictEqual(currentURL(), authenticateURL);
assert.ok(find('.rose-message'));
});
@@ -130,99 +130,99 @@ module('Acceptance | authentication', function (hooks) {
});
await visit(authMethodAuthenticateURL);
await a11yAudit();
assert.equal(currentURL(), authMethodAuthenticateURL);
assert.strictEqual(currentURL(), authMethodAuthenticateURL);
});
test('visiting any authentication parent route while unauthenticated redirects to first global authenticate method', async function (assert) {
assert.expect(3);
await visit(indexURL);
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
assert.strictEqual(currentURL(), authMethodGlobalAuthenticateURL);
await visit(scopesURL);
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
assert.strictEqual(currentURL(), authMethodGlobalAuthenticateURL);
assert.notOk(currentSession().isAuthenticated);
});
test('visiting change password while unauthenticated redirects to first global authenticate method', async function (assert) {
assert.expect(2);
await visit(changePasswordURL);
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
assert.strictEqual(currentURL(), authMethodGlobalAuthenticateURL);
assert.notOk(currentSession().isAuthenticated);
});
test('visiting orgs while unauthenticated redirects to first global authenticate method', async function (assert) {
assert.expect(2);
await visit(orgsURL);
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
assert.strictEqual(currentURL(), authMethodGlobalAuthenticateURL);
assert.notOk(currentSession().isAuthenticated);
});
test('visiting org edit while unauthenticated redirects to first global authenticate method', async function (assert) {
assert.expect(2);
await visit(orgEditURL);
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
assert.strictEqual(currentURL(), authMethodGlobalAuthenticateURL);
assert.notOk(currentSession().isAuthenticated);
});
test('visiting projects while unauthenticated redirects to first global authenticate method', async function (assert) {
assert.expect(2);
await visit(projectsURL);
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
assert.strictEqual(currentURL(), authMethodGlobalAuthenticateURL);
assert.notOk(currentSession().isAuthenticated);
});
test('visiting new project while unauthenticated redirects to first global authenticate method', async function (assert) {
assert.expect(2);
await visit(newProjectURL);
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
assert.strictEqual(currentURL(), authMethodGlobalAuthenticateURL);
assert.notOk(currentSession().isAuthenticated);
});
test('visiting users while unauthenticated redirects to first global authenticate method', async function (assert) {
assert.expect(2);
await visit(usersURL);
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
assert.strictEqual(currentURL(), authMethodGlobalAuthenticateURL);
assert.notOk(currentSession().isAuthenticated);
});
test('visiting roles while unauthenticated redirects to first global authenticate method', async function (assert) {
assert.expect(2);
await visit(rolesURL);
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
assert.strictEqual(currentURL(), authMethodGlobalAuthenticateURL);
assert.notOk(currentSession().isAuthenticated);
});
test('visiting groups while unauthenticated redirects to first global authenticate method', async function (assert) {
assert.expect(2);
await visit(groupsURL);
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
assert.strictEqual(currentURL(), authMethodGlobalAuthenticateURL);
assert.notOk(currentSession().isAuthenticated);
});
test('visiting host catalogs while unauthenticated redirects to first global authenticate method', async function (assert) {
assert.expect(2);
await visit(hostCatalogsURL);
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
assert.strictEqual(currentURL(), authMethodGlobalAuthenticateURL);
assert.notOk(currentSession().isAuthenticated);
});
test('visiting targets while unauthenticated redirects to first global authenticate method', async function (assert) {
assert.expect(2);
await visit(targetsURL);
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
assert.strictEqual(currentURL(), authMethodGlobalAuthenticateURL);
assert.notOk(currentSession().isAuthenticated);
});
test('visiting sessions while unauthenticated redirects to first global authenticate method', async function (assert) {
assert.expect(2);
await visit(sessionsURL);
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
assert.strictEqual(currentURL(), authMethodGlobalAuthenticateURL);
assert.notOk(currentSession().isAuthenticated);
});
test('visiting auth methods while unauthenticated redirects to first global authenticate method', async function (assert) {
assert.expect(2);
await visit(authMethodsURL);
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
assert.strictEqual(currentURL(), authMethodGlobalAuthenticateURL);
assert.notOk(currentSession().isAuthenticated);
});
@@ -230,22 +230,22 @@ module('Acceptance | authentication', function (hooks) {
assert.expect(1);
await visit(authMethodAuthenticateURL);
await a11yAudit();
assert.equal(currentURL(), authMethodAuthenticateURL);
assert.strictEqual(currentURL(), authMethodAuthenticateURL);
});
test('visiting any authentication parent route while already authenticated with an org redirects to projects', async function (assert) {
assert.expect(6);
authenticateSession({ scope });
await visit(indexURL);
assert.equal(currentURL(), projectsURL);
assert.strictEqual(currentURL(), projectsURL);
await visit(scopesURL);
assert.equal(currentURL(), projectsURL);
assert.strictEqual(currentURL(), projectsURL);
await visit(orgScopeURL);
assert.equal(currentURL(), projectsURL);
assert.strictEqual(currentURL(), projectsURL);
await visit(authenticateURL);
assert.equal(currentURL(), projectsURL);
assert.strictEqual(currentURL(), projectsURL);
await visit(authMethodAuthenticateURL);
assert.equal(currentURL(), projectsURL);
assert.strictEqual(currentURL(), projectsURL);
assert.ok(currentSession().isAuthenticated);
});
@@ -255,11 +255,11 @@ module('Acceptance | authentication', function (hooks) {
scope: { id: globalScope.id, type: globalScope.type },
});
await visit(indexURL);
assert.equal(currentURL(), orgsURL);
assert.strictEqual(currentURL(), orgsURL);
await visit(scopesURL);
assert.equal(currentURL(), orgsURL);
assert.strictEqual(currentURL(), orgsURL);
await visit(globalAuthenticateURL);
assert.equal(currentURL(), orgsURL);
assert.strictEqual(currentURL(), orgsURL);
assert.ok(currentSession().isAuthenticated);
});
@@ -277,11 +277,11 @@ module('Acceptance | authentication', function (hooks) {
assert.expect(4);
await visit(authMethodGlobalAuthenticateURL);
assert.notOk(currentSession().isAuthenticated);
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
assert.strictEqual(currentURL(), authMethodGlobalAuthenticateURL);
await fillIn('[name="identification"]', 'test');
await fillIn('[name="password"]', 'test');
await click('[type="submit"]');
assert.equal(currentURL(), orgsURL);
assert.strictEqual(currentURL(), orgsURL);
assert.ok(currentSession().isAuthenticated);
});
@@ -289,11 +289,11 @@ module('Acceptance | authentication', function (hooks) {
assert.expect(4);
await visit(authMethodAuthenticateURL);
assert.notOk(currentSession().isAuthenticated);
assert.equal(currentURL(), authMethodAuthenticateURL);
assert.strictEqual(currentURL(), authMethodAuthenticateURL);
await fillIn('[name="identification"]', 'test');
await fillIn('[name="password"]', 'test');
await click('[type="submit"]');
assert.equal(currentURL(), projectsURL);
assert.strictEqual(currentURL(), projectsURL);
assert.ok(currentSession().isAuthenticated);
});
@@ -348,12 +348,12 @@ module('Acceptance | authentication', function (hooks) {
assert.notOk(getRootElement().classList.contains('rose-theme-dark'));
// toggle light mode
await click('[name="theme"][value="light"]');
assert.equal(currentSession().get('data.theme'), 'light');
assert.strictEqual(currentSession().get('data.theme'), 'light');
assert.ok(getRootElement().classList.contains('rose-theme-light'));
assert.notOk(getRootElement().classList.contains('rose-theme-dark'));
// toggle dark mode
await click('[name="theme"][value="dark"]');
assert.equal(currentSession().get('data.theme'), 'dark');
assert.strictEqual(currentSession().get('data.theme'), 'dark');
assert.notOk(getRootElement().classList.contains('rose-theme-light'));
assert.ok(getRootElement().classList.contains('rose-theme-dark'));
// toggle system default
@@ -68,10 +68,10 @@ module('Acceptance | credential-libraries | create', function (hooks) {
assert.expect(2);
await visit(urls.credentialLibraries);
await a11yAudit();
assert.equal(currentURL(), urls.credentialLibraries);
assert.strictEqual(currentURL(), urls.credentialLibraries);
await visit(urls.credentialLibrary);
await a11yAudit();
assert.equal(currentURL(), urls.credentialLibrary);
assert.strictEqual(currentURL(), urls.credentialLibrary);
});
test('can create a credential library', async function (assert) {
@@ -80,7 +80,7 @@ module('Acceptance | credential-libraries | create', function (hooks) {
await visit(urls.newCredentialLibrary);
await fillIn('[name="name"]', 'random string');
await click('[type="submit"]');
assert.equal(getCredentialLibraryCount(), count + 1);
assert.strictEqual(getCredentialLibraryCount(), count + 1);
});
test('Users cannot navigate to new credential library route without proper authorization', async function (assert) {
@@ -103,8 +103,8 @@ module('Acceptance | credential-libraries | create', function (hooks) {
await visit(urls.newCredentialLibrary);
await fillIn('[name="name"]', 'random string');
await click('.rose-form-actions [type="button"]');
assert.equal(currentURL(), urls.credentialLibraries);
assert.equal(getCredentialLibraryCount(), count);
assert.strictEqual(currentURL(), urls.credentialLibraries);
assert.strictEqual(getCredentialLibraryCount(), count);
});
test('saving a new credential library with invalid fields displays error messasges', async function (assert) {
@@ -72,7 +72,7 @@ module('Acceptance | credential-libraries | delete', function (hooks) {
const count = getCredentialLibraryCount();
await visit(urls.credentialLibrary);
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
assert.equal(getCredentialLibraryCount(), count - 1);
assert.strictEqual(getCredentialLibraryCount(), count - 1);
});
test('cannot delete resource without proper authorization', async function (assert) {
@@ -95,7 +95,7 @@ module('Acceptance | credential-libraries | delete', function (hooks) {
const count = getCredentialLibraryCount();
await visit(urls.credentialLibrary);
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
assert.equal(getCredentialLibraryCount(), count - 1);
assert.strictEqual(getCredentialLibraryCount(), count - 1);
assert.ok(confirmService.confirm.calledOnce);
});
@@ -107,7 +107,7 @@ module('Acceptance | credential-libraries | delete', function (hooks) {
const count = getCredentialLibraryCount();
await visit(urls.credentialLibrary);
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
assert.equal(getCredentialLibraryCount(), count);
assert.strictEqual(getCredentialLibraryCount(), count);
assert.ok(confirmService.confirm.calledOnce);
});
@@ -65,7 +65,7 @@ module('Acceptance | credential-libraries | read', function (hooks) {
await visit(urls.credentialLibraries);
await click('main tbody .rose-table-header-cell a');
await a11yAudit();
assert.equal(currentURL(), urls.credentialLibrary);
assert.strictEqual(currentURL(), urls.credentialLibrary);
});
test('cannot navigate to resource without proper authorization', async function (assert) {
@@ -67,8 +67,8 @@ module('Acceptance | credential-libraries | update', function (hooks) {
await click('form [type="button"]', 'Activate edit mode');
await fillIn('[name="name"]', 'random string');
await click('.rose-form-actions [type="submit"]');
assert.equal(currentURL(), urls.credentialLibrary);
assert.equal(
assert.strictEqual(currentURL(), urls.credentialLibrary);
assert.strictEqual(
this.server.schema.credentialLibraries.all().models[0].name,
'random string'
);
@@ -94,7 +94,7 @@ module('Acceptance | credential-libraries | update', function (hooks) {
this.server.schema.credentialLibraries.all().models[0].name,
'random string'
);
assert.equal(find('[name="name"]').value, instances.credentialLibrary.name);
assert.strictEqual(find('[name="name"]').value, instances.credentialLibrary.name);
});
test('saving an existing credential library with invalid fields displays error messages', async function (assert) {
@@ -141,14 +141,14 @@ module('Acceptance | credential-libraries | update', function (hooks) {
await visit(urls.credentialLibrary);
await click('form [type="button"]', 'Activate edit mode');
await fillIn('[name="name"]', 'random string');
assert.equal(currentURL(), urls.credentialLibrary);
assert.strictEqual(currentURL(), urls.credentialLibrary);
try {
await visit(urls.credentialLibraries);
} catch (e) {
assert.ok(find('.rose-dialog'));
await click('.rose-dialog-footer button:first-child', 'Click Discard');
assert.equal(currentURL(), urls.credentialLibraries);
assert.strictEqual(currentURL(), urls.credentialLibraries);
assert.notEqual(
this.server.schema.credentialLibraries.all().models[0].name,
'random string'
@@ -164,14 +164,14 @@ module('Acceptance | credential-libraries | update', function (hooks) {
await visit(urls.credentialLibrary);
await click('form [type="button"]', 'Activate edit mode');
await fillIn('[name="name"]', 'random string');
assert.equal(currentURL(), urls.credentialLibrary);
assert.strictEqual(currentURL(), urls.credentialLibrary);
try {
await visit(urls.credentialLibraries);
} catch (e) {
assert.ok(find('.rose-dialog'));
await click('.rose-dialog-footer button:last-child');
assert.equal(currentURL(), urls.credentialLibrary);
assert.strictEqual(currentURL(), urls.credentialLibrary);
assert.notEqual(
this.server.schema.credentialLibraries.all().models[0].name,
'random string'
@@ -60,7 +60,7 @@ module('Acceptance | credential-stores | create', function (hooks) {
await visit(urls.newCredentialStore);
await fillIn('[name="name"]', 'random string');
await click('[type="submit"]');
assert.equal(getCredentialStoresCount(), count + 1);
assert.strictEqual(getCredentialStoresCount(), count + 1);
});
test('Users can cancel create new credential stores', async function (assert) {
@@ -69,8 +69,8 @@ module('Acceptance | credential-stores | create', function (hooks) {
await visit(urls.newCredentialStore);
await fillIn('[name="name"]', 'random string');
await click('.rose-form-actions [type="button"]');
assert.equal(currentURL(), urls.credentialStores);
assert.equal(getCredentialStoresCount(), count);
assert.strictEqual(currentURL(), urls.credentialStores);
assert.strictEqual(getCredentialStoresCount(), count);
});
test('Users cannot navigate to new credential stores route without proper authorization', async function (assert) {
@@ -65,7 +65,7 @@ module('Acceptance | credential-stores | delete', function (hooks) {
const count = getCredentialStoresCount();
await visit(urls.credentialStore);
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
assert.equal(getCredentialStoresCount(), count - 1);
assert.strictEqual(getCredentialStoresCount(), count - 1);
});
test('cannot delete a credential store without proper authorization', async function (assert) {
@@ -88,7 +88,7 @@ module('Acceptance | credential-stores | delete', function (hooks) {
const count = getCredentialStoresCount();
await visit(urls.credentialStore);
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
assert.equal(getCredentialStoresCount(), count - 1);
assert.strictEqual(getCredentialStoresCount(), count - 1);
assert.ok(confirmService.confirm.calledOnce);
});
@@ -100,7 +100,7 @@ module('Acceptance | credential-stores | delete', function (hooks) {
const count = getCredentialStoresCount();
await visit(urls.credentialStore);
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
assert.equal(getCredentialStoresCount(), count);
assert.strictEqual(getCredentialStoresCount(), count);
assert.ok(confirmService.confirm.calledOnce);
});
@@ -56,10 +56,10 @@ module('Acceptance | credential-stores | read', function (hooks) {
assert.expect(2);
await visit(urls.credentialStores);
await a11yAudit();
assert.equal(currentURL(), urls.credentialStores);
assert.strictEqual(currentURL(), urls.credentialStores);
await visit(urls.credentialStore);
await a11yAudit();
assert.equal(currentURL(), urls.credentialStore);
assert.strictEqual(currentURL(), urls.credentialStore);
});
test('cannot navigate to a credential store form without proper authorization', async function (assert) {
@@ -76,7 +76,7 @@ module('Acceptance | credential-stores | read', function (hooks) {
assert.expect(1);
await visit(urls.unknownCredentialStore);
await a11yAudit();
assert.equal(
assert.strictEqual(
find('.rose-message-subtitle').textContent.trim(),
'Error 404'
);
@@ -59,8 +59,8 @@ module('Acceptance | credential-stores | update', function (hooks) {
await click('form [type="button"]', 'Activate edit mode');
await fillIn('[name="name"]', 'random string');
await click('.rose-form-actions [type="submit"]');
assert.equal(currentURL(), urls.credentialStore);
assert.equal(
assert.strictEqual(currentURL(), urls.credentialStore);
assert.strictEqual(
this.server.schema.credentialStores.all().models[0].name,
'random string'
);
@@ -83,7 +83,7 @@ module('Acceptance | credential-stores | update', function (hooks) {
await fillIn('[name="name"]', 'random string');
await click('.rose-form-actions [type="button"]');
assert.notEqual(instances.credentialStore.name, 'random string');
assert.equal(find('[name="name"]').value, instances.credentialStore.name);
assert.strictEqual(find('[name="name"]').value, instances.credentialStore.name);
});
test('saving an existing credential store with invalid fields displays error messages', async function (assert) {
@@ -130,14 +130,14 @@ module('Acceptance | credential-stores | update', function (hooks) {
await visit(urls.credentialStore);
await click('form [type="button"]', 'Activate edit mode');
await fillIn('[name="name"]', 'random string');
assert.equal(currentURL(), urls.credentialStore);
assert.strictEqual(currentURL(), urls.credentialStore);
try {
await visit(urls.credentialStores);
} catch (e) {
assert.ok(find('.rose-dialog'));
await click('.rose-dialog-footer button:first-child', 'Click Discard');
assert.equal(currentURL(), urls.credentialStores);
assert.strictEqual(currentURL(), urls.credentialStores);
assert.notEqual(
this.server.schema.credentialStores.all().models[0].name,
'random string'
@@ -153,14 +153,14 @@ module('Acceptance | credential-stores | update', function (hooks) {
await visit(urls.credentialStore);
await click('form [type="button"]', 'Activate edit mode');
await fillIn('[name="name"]', 'random string');
assert.equal(currentURL(), urls.credentialStore);
assert.strictEqual(currentURL(), urls.credentialStore);
try {
await visit(urls.credentialStores);
} catch (e) {
assert.ok(find('.rose-dialog'));
await click('.rose-dialog-footer button:last-child');
assert.equal(currentURL(), urls.credentialStore);
assert.strictEqual(currentURL(), urls.credentialStore);
assert.notEqual(
this.server.schema.credentialStores.all().models[0].name,
'random string'
@@ -52,7 +52,7 @@ module('Acceptance | groups | create', function (hooks) {
await visit(urls.newGroup);
await fillIn('[name="name"]', 'group name');
await click('[type="submit"]');
assert.equal(this.server.db.groups.length, groupsCount + 1);
assert.strictEqual(this.server.db.groups.length, groupsCount + 1);
});
test('can navigate to new groups route with proper authorization', async function (assert) {
@@ -79,8 +79,8 @@ module('Acceptance | groups | create', function (hooks) {
await visit(urls.newGroup);
await fillIn('[name="name"]', 'group name');
await click('.rose-form-actions [type="button"]');
assert.equal(currentURL(), urls.groups);
assert.equal(this.server.db.groups.length, groupsCount);
assert.strictEqual(currentURL(), urls.groups);
assert.strictEqual(this.server.db.groups.length, groupsCount);
});
test('saving a new group with invalid fields displays error messages', async function (assert) {
@@ -107,12 +107,12 @@ module('Acceptance | groups | create', function (hooks) {
await visit(urls.newGroup);
await fillIn('[name="name"]', 'group name');
await click('[type="submit"]');
assert.equal(
assert.strictEqual(
find('.rose-notification-body').textContent.trim(),
'The request was invalid.',
'Displays primary error message.'
);
assert.equal(
assert.strictEqual(
find('.rose-form-error-message').textContent.trim(),
'Name is required.',
'Displays field-level errors.'
@@ -48,7 +48,7 @@ module('Acceptance | groups | delete', function (hooks) {
const groupsCount = this.server.db.groups.length;
await visit(urls.group);
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
assert.equal(this.server.db.groups.length, groupsCount - 1);
assert.strictEqual(this.server.db.groups.length, groupsCount - 1);
});
test('cannot delete a group without proper authorization', async function (assert) {
@@ -76,7 +76,7 @@ module('Acceptance | groups | delete', function (hooks) {
});
await visit(urls.group);
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
assert.equal(
assert.strictEqual(
find('.rose-notification-body').textContent.trim(),
'Oops.',
'Displays primary error message.'
@@ -56,16 +56,16 @@ module('Acceptance | groups | members', function (hooks) {
assert.expect(2);
await visit(urls.members);
await a11yAudit();
assert.equal(currentURL(), urls.members);
assert.equal(findAll('tbody tr').length, membersCount);
assert.strictEqual(currentURL(), urls.members);
assert.strictEqual(findAll('tbody tr').length, membersCount);
});
test('can remove a member', async function (assert) {
assert.expect(2);
await visit(urls.members);
assert.equal(findAll('tbody tr').length, membersCount);
assert.strictEqual(findAll('tbody tr').length, membersCount);
await click('tbody tr .rose-dropdown-button-danger');
assert.equal(findAll('tbody tr').length, membersCount - 1);
assert.strictEqual(findAll('tbody tr').length, membersCount - 1);
});
test('cannot remove a member without proper authorization', async function (assert) {
@@ -93,7 +93,7 @@ module('Acceptance | groups | members', function (hooks) {
);
});
await visit(urls.members);
assert.equal(findAll('tbody tr').length, membersCount);
assert.strictEqual(findAll('tbody tr').length, membersCount);
await click('tbody tr .rose-dropdown-button-danger');
assert.ok(find('[role="alert"]'));
});
@@ -102,7 +102,7 @@ module('Acceptance | groups | members', function (hooks) {
assert.expect(1);
await visit(urls.addMembers);
await a11yAudit();
assert.equal(currentURL(), urls.addMembers);
assert.strictEqual(currentURL(), urls.addMembers);
});
test('can navigate to add members with proper authorization', async function (assert) {
@@ -125,30 +125,30 @@ module('Acceptance | groups | members', function (hooks) {
assert.expect(3);
instances.group.update({ memberIds: [] });
await visit(urls.members);
assert.equal(findAll('tbody tr').length, 0);
assert.strictEqual(findAll('tbody tr').length, 0);
await click('.rose-layout-page-actions a');
assert.equal(currentURL(), urls.addMembers);
assert.strictEqual(currentURL(), urls.addMembers);
// Click three times to select, unselect, then reselect (for coverage)
await click('tbody label');
await click('tbody label');
await click('tbody label');
await click('form [type="submit"]');
await visit(urls.members);
assert.equal(findAll('tbody tr').length, 1);
assert.strictEqual(findAll('tbody tr').length, 1);
});
test('select and cancel members to add', async function (assert) {
assert.expect(4);
await visit(urls.members);
assert.equal(findAll('tbody tr').length, membersCount);
assert.strictEqual(findAll('tbody tr').length, membersCount);
await click('tbody tr .rose-dropdown-button-danger');
assert.equal(findAll('tbody tr').length, membersCount - 1);
assert.strictEqual(findAll('tbody tr').length, membersCount - 1);
await click('.rose-layout-page-actions a');
assert.equal(currentURL(), urls.addMembers);
assert.strictEqual(currentURL(), urls.addMembers);
await click('tbody label');
await click('form [type="button"]');
await visit(urls.members);
assert.equal(findAll('tbody tr').length, membersCount - 1);
assert.strictEqual(findAll('tbody tr').length, membersCount - 1);
});
test('shows error message on member add', async function (assert) {
@@ -47,7 +47,7 @@ module('Acceptance | groups | read', function (hooks) {
assert.expect(1);
await visit(urls.newGroup);
await a11yAudit();
assert.equal(currentURL(), urls.newGroup);
assert.strictEqual(currentURL(), urls.newGroup);
});
test('cannot navigate to a group form without proper authorization', async function (assert) {
@@ -49,8 +49,8 @@ module('Acceptance | groups | update', function (hooks) {
await click('form [type="button"]', 'Activate edit mode');
await fillIn('[name="name"]', 'Updated admin group');
await click('.rose-form-actions [type="submit"]');
assert.equal(currentURL(), urls.group);
assert.equal(this.server.db.groups[0].name, 'Updated admin group');
assert.strictEqual(currentURL(), urls.group);
assert.strictEqual(this.server.db.groups[0].name, 'Updated admin group');
});
test('cannot make changes to an existing group without proper authorization', async function (assert) {
@@ -95,12 +95,12 @@ module('Acceptance | groups | update', function (hooks) {
await click('form [type="button"]', 'Activate edit mode');
await fillIn('[name="name"]', 'random string');
await click('[type="submit"]');
assert.equal(
assert.strictEqual(
find('.rose-notification-body').textContent.trim(),
'The request was invalid.',
'Displays primary error message.'
);
assert.equal(
assert.strictEqual(
find('.rose-form-error-message').textContent.trim(),
'Name is required.',
'Displays field-level errors.'
@@ -83,7 +83,7 @@ module('Acceptance | host-catalogs | create', function (hooks) {
await fillIn('[name="description"]', 'random string');
await fillIn('[name="types"]', 'static');
await click('[type="submit"]');
assert.equal(gethostCatalogCount(), count + 1);
assert.strictEqual(gethostCatalogCount(), count + 1);
});
test('Users can create new dynamic host catalogs', async function (assert) {
@@ -94,7 +94,7 @@ module('Acceptance | host-catalogs | create', function (hooks) {
await fillIn('[name="description"]', 'random string');
await fillIn('[name="types"]', 'aws');
await click('[type="submit"]');
assert.equal(gethostCatalogCount(), count + 1);
assert.strictEqual(gethostCatalogCount(), count + 1);
});
test('Users can cancel creation of new static host catalogs', async function (assert) {
@@ -103,8 +103,8 @@ module('Acceptance | host-catalogs | create', function (hooks) {
await visit(urls.newStaticHostCatalog);
await fillIn('[name="name"]', 'random string');
await click('.rose-form-actions [type="button"]');
assert.equal(currentURL(), urls.hostCatalogs);
assert.equal(gethostCatalogCount(), count);
assert.strictEqual(currentURL(), urls.hostCatalogs);
assert.strictEqual(gethostCatalogCount(), count);
});
test('Users can cancel creation of new dynamic host catalogs', async function (assert) {
@@ -113,8 +113,8 @@ module('Acceptance | host-catalogs | create', function (hooks) {
await visit(urls.newDynamicHostCatalog);
await fillIn('[name="name"]', 'random string');
await click('.rose-form-actions [type="button"]');
assert.equal(currentURL(), urls.hostCatalogs);
assert.equal(gethostCatalogCount(), count);
assert.strictEqual(currentURL(), urls.hostCatalogs);
assert.strictEqual(gethostCatalogCount(), count);
});
test('Users can navigate to new static host catalogs route with proper authorization', async function (assert) {
Loaded 100 of 161 files, more files were not shown because too many files have changed in this diff. Show more