chore: 🤖 Upgrade eslint-plugin-qunit (#2011)
* chore: 🤖 Upgrade eslint-plugin-qunit
* Delete unnecessary assert.expect from tests
This commit is contained in:
1 parent
a94572214c
commit
b51c8203ee
227 files changed
+32
-1179
No files matched your search
@@ -59,6 +59,9 @@ module.exports = {
|
||||
// Test files:
|
||||
files: ['tests/**/*-test.{js,ts}'],
|
||||
extends: ['plugin:qunit/recommended'],
|
||||
rules: {
|
||||
'qunit/require-expect': [2, 'except-simple'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -61,7 +61,7 @@
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-ember": "^11.11.1",
|
||||
"eslint-plugin-n": "^16.3.1",
|
||||
"eslint-plugin-qunit": "^7.3.4",
|
||||
"eslint-plugin-qunit": "^8.0.1",
|
||||
"js-bexpr": "hashicorp/js-bexpr#9b4a4b54d85eba67fdfc0990133d1518d890b1e1",
|
||||
"loader.js": "^4.7.0",
|
||||
"prettier": "^3.0.0",
|
||||
|
||||
@@ -23,7 +23,6 @@ module('Unit | Abilities | Account', function (hooks) {
|
||||
});
|
||||
|
||||
test('it reflects when a given account may set password based on authorized_actions', function (assert) {
|
||||
assert.expect(2);
|
||||
const account = store.createRecord('auth-method', {
|
||||
authorized_actions: ['set-password'],
|
||||
});
|
||||
@@ -33,7 +32,6 @@ module('Unit | Abilities | Account', function (hooks) {
|
||||
});
|
||||
|
||||
test('can read known account types when authorized', function (assert) {
|
||||
assert.expect(4);
|
||||
const account = store.createRecord('account', {
|
||||
authorized_actions: ['read'],
|
||||
type: TYPE_AUTH_METHOD_OIDC,
|
||||
@@ -48,7 +46,6 @@ module('Unit | Abilities | Account', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot read accounts when unauthorized', function (assert) {
|
||||
assert.expect(4);
|
||||
const account = store.createRecord('account', {
|
||||
authorized_actions: [],
|
||||
type: TYPE_AUTH_METHOD_OIDC,
|
||||
@@ -63,7 +60,6 @@ module('Unit | Abilities | Account', function (hooks) {
|
||||
});
|
||||
|
||||
test('can delete known account types when authorized', function (assert) {
|
||||
assert.expect(4);
|
||||
const account = store.createRecord('account', {
|
||||
authorized_actions: ['delete'],
|
||||
type: TYPE_AUTH_METHOD_OIDC,
|
||||
@@ -78,7 +74,6 @@ module('Unit | Abilities | Account', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot delete accounts when unauthorized', function (assert) {
|
||||
assert.expect(4);
|
||||
const account = store.createRecord('account', {
|
||||
authorized_actions: ['delete'],
|
||||
type: TYPE_AUTH_METHOD_OIDC,
|
||||
@@ -93,7 +88,6 @@ module('Unit | Abilities | Account', function (hooks) {
|
||||
});
|
||||
|
||||
test('can update known account types when authorized', function (assert) {
|
||||
assert.expect(4);
|
||||
const account = store.createRecord('account', {
|
||||
authorized_actions: ['update'],
|
||||
type: TYPE_AUTH_METHOD_OIDC,
|
||||
@@ -108,7 +102,6 @@ module('Unit | Abilities | Account', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot update accounts when unauthorized', function (assert) {
|
||||
assert.expect(4);
|
||||
const account = store.createRecord('account', {
|
||||
authorized_actions: [],
|
||||
type: TYPE_AUTH_METHOD_OIDC,
|
||||
|
||||
@@ -23,7 +23,6 @@ module('Unit | Abilities | Auth Method', function (hooks) {
|
||||
});
|
||||
|
||||
test('can read known auth method types when authorized', function (assert) {
|
||||
assert.expect(4);
|
||||
const authMethod = store.createRecord('auth-method', {
|
||||
authorized_actions: ['read'],
|
||||
type: TYPE_AUTH_METHOD_OIDC,
|
||||
@@ -38,7 +37,6 @@ module('Unit | Abilities | Auth Method', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot read auth methods when unauthorized', function (assert) {
|
||||
assert.expect(4);
|
||||
const authMethod = store.createRecord('auth-method', {
|
||||
authorized_actions: [],
|
||||
type: TYPE_AUTH_METHOD_OIDC,
|
||||
@@ -53,7 +51,6 @@ module('Unit | Abilities | Auth Method', function (hooks) {
|
||||
});
|
||||
|
||||
test('can delete known auth method types when authorized', function (assert) {
|
||||
assert.expect(4);
|
||||
const authMethod = store.createRecord('auth-method', {
|
||||
authorized_actions: ['delete'],
|
||||
type: TYPE_AUTH_METHOD_OIDC,
|
||||
@@ -68,7 +65,6 @@ module('Unit | Abilities | Auth Method', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot delete auth methods when unauthorized', function (assert) {
|
||||
assert.expect(4);
|
||||
const authMethod = store.createRecord('auth-method', {
|
||||
authorized_actions: ['delete'],
|
||||
type: TYPE_AUTH_METHOD_OIDC,
|
||||
@@ -83,7 +79,6 @@ module('Unit | Abilities | Auth Method', function (hooks) {
|
||||
});
|
||||
|
||||
test('can update known auth method types when authorized', function (assert) {
|
||||
assert.expect(4);
|
||||
const authMethod = store.createRecord('auth-method', {
|
||||
authorized_actions: ['update'],
|
||||
type: TYPE_AUTH_METHOD_OIDC,
|
||||
@@ -98,7 +93,6 @@ module('Unit | Abilities | Auth Method', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot update auth methods when unauthorized', function (assert) {
|
||||
assert.expect(4);
|
||||
const authMethod = store.createRecord('auth-method', {
|
||||
authorized_actions: [],
|
||||
type: TYPE_AUTH_METHOD_OIDC,
|
||||
|
||||
@@ -25,8 +25,6 @@ module('Unit | Ability | channel-recording', function (hooks) {
|
||||
});
|
||||
|
||||
test('it can download asciicast', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
const sessionRecordingModel = store.createRecord('session-recording', {
|
||||
authorized_actions: ['download'],
|
||||
type: TYPE_SESSION_RECORDING_SSH,
|
||||
@@ -48,8 +46,6 @@ module('Unit | Ability | channel-recording', function (hooks) {
|
||||
});
|
||||
|
||||
test('it cannot download asciicast without the correct mime type', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
const sessionRecordingModel = store.createRecord('session-recording', {
|
||||
authorized_actions: ['download'],
|
||||
type: TYPE_SESSION_RECORDING_SSH,
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Abilities | Group', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it reflects when a given group resource may add members based on authorized_actions', function (assert) {
|
||||
assert.expect(2);
|
||||
const service = this.owner.lookup('service:can');
|
||||
const model = {
|
||||
authorized_actions: ['add-members'],
|
||||
@@ -21,7 +20,6 @@ module('Unit | Abilities | Group', function (hooks) {
|
||||
});
|
||||
|
||||
test('it reflects when a given group resource may remove members based on authorized_actions', function (assert) {
|
||||
assert.expect(2);
|
||||
const service = this.owner.lookup('service:can');
|
||||
const model = {
|
||||
authorized_actions: ['remove-members'],
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Abilities | Host Set', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it reflects when a given host set resource may add hosts based on authorized_actions', function (assert) {
|
||||
assert.expect(2);
|
||||
const service = this.owner.lookup('service:can');
|
||||
const model = {
|
||||
authorized_actions: ['add-hosts'],
|
||||
@@ -21,7 +20,6 @@ module('Unit | Abilities | Host Set', function (hooks) {
|
||||
});
|
||||
|
||||
test('it reflects when a given hostSet resource may remove hosts based on authorized_actions', function (assert) {
|
||||
assert.expect(2);
|
||||
const service = this.owner.lookup('service:can');
|
||||
const model = {
|
||||
authorized_actions: ['remove-hosts'],
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Abilities | Model', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it reflects when a given model may be read based on authorized_actions', function (assert) {
|
||||
assert.expect(2);
|
||||
const service = this.owner.lookup('service:can');
|
||||
const model = {
|
||||
authorized_actions: ['read'],
|
||||
@@ -21,7 +20,6 @@ module('Unit | Abilities | Model', function (hooks) {
|
||||
});
|
||||
|
||||
test('it reflects when a given model may be updated based on authorized_actions', function (assert) {
|
||||
assert.expect(2);
|
||||
const service = this.owner.lookup('service:can');
|
||||
const model = {
|
||||
authorized_actions: ['update'],
|
||||
@@ -32,7 +30,6 @@ module('Unit | Abilities | Model', function (hooks) {
|
||||
});
|
||||
|
||||
test('it reflects when a given model may be saved based on isNew and authorized_actions', function (assert) {
|
||||
assert.expect(4);
|
||||
const service = this.owner.lookup('service:can');
|
||||
let model = {
|
||||
isNew: false,
|
||||
@@ -61,7 +58,6 @@ module('Unit | Abilities | Model', function (hooks) {
|
||||
});
|
||||
|
||||
test('it reflects when a given model may be deleted based on authorized_actions', function (assert) {
|
||||
assert.expect(2);
|
||||
const service = this.owner.lookup('service:can');
|
||||
const model = {
|
||||
authorized_actions: ['delete'],
|
||||
@@ -74,7 +70,6 @@ module('Unit | Abilities | Model', function (hooks) {
|
||||
// =collections
|
||||
|
||||
test('it reflects when a resource may be listed based on authorized_collection_actions', function (assert) {
|
||||
assert.expect(2);
|
||||
const service = this.owner.lookup('service:can');
|
||||
const model = {
|
||||
authorized_collection_actions: {
|
||||
@@ -87,7 +82,6 @@ module('Unit | Abilities | Model', function (hooks) {
|
||||
});
|
||||
|
||||
test('it reflects when a resource may be created based on authorized_collection_actions', function (assert) {
|
||||
assert.expect(2);
|
||||
const service = this.owner.lookup('service:can');
|
||||
const model = {
|
||||
authorized_collection_actions: {
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Abilities | Role', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it reflects when a given role may set grants based on authorized_actions', function (assert) {
|
||||
assert.expect(2);
|
||||
const service = this.owner.lookup('service:can');
|
||||
const model = {
|
||||
authorized_actions: ['set-grants'],
|
||||
@@ -21,7 +20,6 @@ module('Unit | Abilities | Role', function (hooks) {
|
||||
});
|
||||
|
||||
test('it reflects when a given role may add principals based on authorized_actions', function (assert) {
|
||||
assert.expect(2);
|
||||
const service = this.owner.lookup('service:can');
|
||||
const model = {
|
||||
authorized_actions: ['add-principals'],
|
||||
@@ -32,7 +30,6 @@ module('Unit | Abilities | Role', function (hooks) {
|
||||
});
|
||||
|
||||
test('it reflects when a given role may remove principals based on authorized_actions', function (assert) {
|
||||
assert.expect(2);
|
||||
const service = this.owner.lookup('service:can');
|
||||
const model = {
|
||||
authorized_actions: ['remove-principals'],
|
||||
@@ -43,7 +40,6 @@ module('Unit | Abilities | Role', function (hooks) {
|
||||
});
|
||||
|
||||
test('it proxies role principal read ability to the appropriate ability type', function (assert) {
|
||||
assert.expect(6);
|
||||
const service = this.owner.lookup('service:can');
|
||||
const user = {
|
||||
constructor: { modelName: 'user' },
|
||||
@@ -69,7 +65,6 @@ module('Unit | Abilities | Role', function (hooks) {
|
||||
});
|
||||
|
||||
test('it throws an error for unknown principal types on principal read check', function (assert) {
|
||||
assert.expect(2);
|
||||
const service = this.owner.lookup('service:can');
|
||||
const account = {
|
||||
constructor: { modelName: 'account' },
|
||||
|
||||
@@ -23,8 +23,6 @@ module('Unit | Ability | session-recording', function (hooks) {
|
||||
});
|
||||
|
||||
test('can download when a recording has download authorization', function (assert) {
|
||||
assert.expect(2);
|
||||
|
||||
const recordingWithAuthorizedAction = store.createRecord(
|
||||
'session-recording',
|
||||
{
|
||||
|
||||
@@ -29,8 +29,6 @@ module('Unit | Ability | session', function (hooks) {
|
||||
});
|
||||
|
||||
test('can read a session that is active', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
const session = store.createRecord('session', {
|
||||
authorized_actions: ['read'],
|
||||
status: STATUS_SESSION_ACTIVE,
|
||||
@@ -40,8 +38,6 @@ module('Unit | Ability | session', function (hooks) {
|
||||
});
|
||||
|
||||
test('can read a session that is pending', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
const session = store.createRecord('session', {
|
||||
authorized_actions: ['read'],
|
||||
status: STATUS_SESSION_PENDING,
|
||||
@@ -51,8 +47,6 @@ module('Unit | Ability | session', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot read a session that is not authorized', function (assert) {
|
||||
assert.expect(4);
|
||||
|
||||
const activeSession = store.createRecord('session', {
|
||||
authorized_actions: [],
|
||||
status: STATUS_SESSION_ACTIVE,
|
||||
@@ -77,8 +71,6 @@ module('Unit | Ability | session', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot read a session that is canceling', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
const session = store.createRecord('session', {
|
||||
authorized_actions: ['read'],
|
||||
status: STATUS_SESSION_CANCELING,
|
||||
@@ -88,8 +80,6 @@ module('Unit | Ability | session', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot read a session that is terminated', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
const session = store.createRecord('session', {
|
||||
authorized_actions: ['read'],
|
||||
status: STATUS_SESSION_TERMINATED,
|
||||
@@ -99,8 +89,6 @@ module('Unit | Ability | session', function (hooks) {
|
||||
});
|
||||
|
||||
test('can read a session that has read:self', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
const session = store.createRecord('session', {
|
||||
authorized_actions: ['read:self'],
|
||||
status: STATUS_SESSION_ACTIVE,
|
||||
@@ -110,8 +98,6 @@ module('Unit | Ability | session', function (hooks) {
|
||||
});
|
||||
|
||||
test('can cancel a session that is active', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
const session = store.createRecord('session', {
|
||||
authorized_actions: ['cancel'],
|
||||
status: STATUS_SESSION_ACTIVE,
|
||||
@@ -121,8 +107,6 @@ module('Unit | Ability | session', function (hooks) {
|
||||
});
|
||||
|
||||
test('can cancel a session that has cancel:self', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
const session = store.createRecord('session', {
|
||||
authorized_actions: ['cancel:self'],
|
||||
status: STATUS_SESSION_ACTIVE,
|
||||
@@ -132,8 +116,6 @@ module('Unit | Ability | session', function (hooks) {
|
||||
});
|
||||
|
||||
test('can cancel a session that is pending', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
const session = store.createRecord('session', {
|
||||
authorized_actions: ['cancel'],
|
||||
status: STATUS_SESSION_PENDING,
|
||||
@@ -143,8 +125,6 @@ module('Unit | Ability | session', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot cancel a session that is canceling', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
const session = store.createRecord('session', {
|
||||
authorized_actions: ['cancel'],
|
||||
status: STATUS_SESSION_CANCELING,
|
||||
@@ -154,8 +134,6 @@ module('Unit | Ability | session', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot cancel a session that is terminated', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
const session = store.createRecord('session', {
|
||||
authorized_actions: ['cancel'],
|
||||
status: STATUS_SESSION_TERMINATED,
|
||||
@@ -165,8 +143,6 @@ module('Unit | Ability | session', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot cancel a session that is not authorized', function (assert) {
|
||||
assert.expect(4);
|
||||
|
||||
const activeSession = store.createRecord('session', {
|
||||
authorized_actions: [],
|
||||
status: STATUS_SESSION_ACTIVE,
|
||||
|
||||
@@ -16,7 +16,6 @@ module('Unit | Abilities | Target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it reflects when a given target may connect based on authorized_actions', function (assert) {
|
||||
assert.expect(2);
|
||||
const model = {
|
||||
authorized_actions: ['authorize-session'],
|
||||
};
|
||||
@@ -26,7 +25,6 @@ module('Unit | Abilities | Target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it reflects when a given target may add host sources', function (assert) {
|
||||
assert.expect(2);
|
||||
const model = {
|
||||
authorized_actions: ['add-host-sources'],
|
||||
};
|
||||
@@ -36,7 +34,6 @@ module('Unit | Abilities | Target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it reflects when a given target may remove host sources', function (assert) {
|
||||
assert.expect(2);
|
||||
const model = {
|
||||
authorized_actions: ['remove-host-sources'],
|
||||
};
|
||||
@@ -46,7 +43,6 @@ module('Unit | Abilities | Target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it reflects when a given target may add brokered credential sources', function (assert) {
|
||||
assert.expect(2);
|
||||
const model = {
|
||||
authorized_actions: ['add-credential-sources'],
|
||||
};
|
||||
@@ -56,7 +52,6 @@ module('Unit | Abilities | Target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it reflects when a given target may remove credential sources', function (assert) {
|
||||
assert.expect(2);
|
||||
const model = {
|
||||
authorized_actions: ['remove-credential-sources'],
|
||||
};
|
||||
@@ -66,7 +61,6 @@ module('Unit | Abilities | Target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it reflects when a given ssh target may add injected application credential sources', function (assert) {
|
||||
assert.expect(3);
|
||||
const model = {
|
||||
authorized_actions: ['add-credential-sources'],
|
||||
isSSH: true,
|
||||
|
||||
@@ -30,7 +30,6 @@ module('Unit | Abilities | User', function (hooks) {
|
||||
});
|
||||
|
||||
test('can add accounts to user when authorized and given a known account type', function (assert) {
|
||||
assert.expect(5);
|
||||
instances.user.authorized_actions = ['add-accounts'];
|
||||
assert.true(canService.can('addAccounts user', instances.user));
|
||||
instances.account.type = TYPE_AUTH_METHOD_OIDC;
|
||||
@@ -60,7 +59,6 @@ module('Unit | Abilities | User', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot add accounts to user when unauthorized', function (assert) {
|
||||
assert.expect(5);
|
||||
instances.user.authorized_actions = [];
|
||||
assert.false(canService.can('addAccounts user', instances.user));
|
||||
instances.account.type = TYPE_AUTH_METHOD_OIDC;
|
||||
@@ -90,7 +88,6 @@ module('Unit | Abilities | User', function (hooks) {
|
||||
});
|
||||
|
||||
test('can remove accounts from user when authorized and given a known account type', function (assert) {
|
||||
assert.expect(5);
|
||||
instances.user.authorized_actions = ['remove-accounts'];
|
||||
assert.true(canService.can('removeAccounts user', instances.user));
|
||||
instances.account.type = TYPE_AUTH_METHOD_OIDC;
|
||||
@@ -120,7 +117,6 @@ module('Unit | Abilities | User', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot remove accounts from user when unauthorized', function (assert) {
|
||||
assert.expect(5);
|
||||
instances.user.authorized_actions = [];
|
||||
assert.false(canService.can('removeAccounts user', instances.user));
|
||||
instances.account.type = TYPE_AUTH_METHOD_OIDC;
|
||||
|
||||
@@ -21,27 +21,23 @@ module('Unit | Adapter | application', function (hooks) {
|
||||
});
|
||||
|
||||
test('its namespace is equal to the configured namespace', function (assert) {
|
||||
assert.expect(2);
|
||||
const adapter = this.owner.lookup('adapter:application');
|
||||
assert.ok(adapter.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.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.strictEqual(adapter.urlSuffix(), '');
|
||||
});
|
||||
|
||||
test('it generates URL suffixes with optional `method` from adapterOptions', function (assert) {
|
||||
assert.expect(2);
|
||||
const method = 'set-something';
|
||||
const adapter = this.owner.lookup('adapter:application');
|
||||
const suffix = adapter.urlSuffix(null, null, {
|
||||
@@ -52,7 +48,6 @@ module('Unit | Adapter | application', function (hooks) {
|
||||
});
|
||||
|
||||
test('it generates correct complete URLs', function (assert) {
|
||||
assert.expect(6);
|
||||
const scopeID = 'o_1';
|
||||
const method = 'my-custom-method';
|
||||
const mockSnapshot = {
|
||||
@@ -146,7 +141,6 @@ module('Unit | Adapter | application', function (hooks) {
|
||||
});
|
||||
|
||||
test('it prenormalizes "empty" responses into a form that the fetch-manager will not reject', async function (assert) {
|
||||
assert.expect(1);
|
||||
const adapter = this.owner.lookup('adapter:application');
|
||||
const store = this.owner.lookup('service:store');
|
||||
this.server.get('/v1/users', () => new Response({}));
|
||||
@@ -160,14 +154,12 @@ module('Unit | Adapter | application', function (hooks) {
|
||||
});
|
||||
|
||||
test('it correctly identifies 400 responses as invalid', function (assert) {
|
||||
assert.expect(2);
|
||||
const adapter = this.owner.lookup('adapter:application');
|
||||
assert.ok(adapter.isInvalid(400));
|
||||
assert.notOk(adapter.isInvalid(401));
|
||||
});
|
||||
|
||||
test('it returns an proper InvalidError from handleResponse', function (assert) {
|
||||
assert.expect(4);
|
||||
const adapter = this.owner.lookup('adapter:application');
|
||||
const payload = {
|
||||
status: 400,
|
||||
@@ -182,7 +174,6 @@ module('Unit | Adapter | application', function (hooks) {
|
||||
});
|
||||
|
||||
test('it assigns convenience booleans for error types', function (assert) {
|
||||
assert.expect(6);
|
||||
const adapter = this.owner.lookup('adapter:application');
|
||||
const getResponse = (status) =>
|
||||
adapter.handleResponse(status, {}, { status });
|
||||
@@ -195,7 +186,6 @@ module('Unit | Adapter | application', function (hooks) {
|
||||
});
|
||||
|
||||
test('it returns field-level errors in InvalidError from handleResponse', function (assert) {
|
||||
assert.expect(1);
|
||||
const adapter = this.owner.lookup('adapter:application');
|
||||
const payload = {
|
||||
status: 400,
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Adapter | host catalog', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it generates correct createRecord URLs for static host catalogs', function (assert) {
|
||||
assert.expect(1);
|
||||
const scopeID = 'o_1';
|
||||
const mockSnapshot = {
|
||||
adapterOptions: {
|
||||
@@ -31,7 +30,6 @@ module('Unit | Adapter | host catalog', function (hooks) {
|
||||
});
|
||||
|
||||
test('it generates correct createRecord URLs for dynamic host catalogs with extra query parameter ?plugin_name', function (assert) {
|
||||
assert.expect(1);
|
||||
const scopeID = 'o_1';
|
||||
const mockSnapshot = {
|
||||
adapterOptions: {
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Adapter | session recording', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it generates correct URLs for downloading asciicast', function (assert) {
|
||||
assert.expect(1);
|
||||
const mockSnapshot = {
|
||||
adapterOptions: {
|
||||
method: 'download',
|
||||
@@ -34,7 +33,6 @@ module('Unit | Adapter | session recording', function (hooks) {
|
||||
});
|
||||
|
||||
test('it generates correct URLs for retrieving session-recordings', function (assert) {
|
||||
assert.expect(1);
|
||||
const adapter = this.owner.lookup('adapter:session-recording');
|
||||
const createRecordURL = adapter.buildURL(
|
||||
'session-recording',
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Adapter | storage bucket', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it generates correct createRecord URLs for storage buckets with extra query parameter ?plugin_name', function (assert) {
|
||||
assert.expect(1);
|
||||
const scopeID = 'o_1';
|
||||
const mockSnapshot = {
|
||||
adapterOptions: {
|
||||
|
||||
@@ -13,7 +13,6 @@ module('Unit | Mixin | build-url', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it does not interfere with basic URLs', function (assert) {
|
||||
assert.expect(1);
|
||||
/* eslint-disable-next-line ember/no-new-mixins, ember/no-classic-classes */
|
||||
const Adapter = RESTAdapter.extend(AdapterBuildURLMixin);
|
||||
this.owner.register('adapter:adapter', Adapter);
|
||||
@@ -23,7 +22,6 @@ module('Unit | Mixin | build-url', function (hooks) {
|
||||
});
|
||||
|
||||
test('it does not interfere with namespaced URLs', function (assert) {
|
||||
assert.expect(1);
|
||||
/* eslint-disable-next-line ember/no-new-mixins, ember/no-classic-classes */
|
||||
const Adapter = RESTAdapter.extend(AdapterBuildURLMixin, {
|
||||
namespace: 'api/v1',
|
||||
@@ -35,7 +33,6 @@ module('Unit | Mixin | build-url', function (hooks) {
|
||||
});
|
||||
|
||||
test('it can prepend a prefix', function (assert) {
|
||||
assert.expect(1);
|
||||
/* eslint-disable-next-line ember/no-new-mixins, ember/no-classic-classes */
|
||||
const Adapter = RESTAdapter.extend(AdapterBuildURLMixin, {
|
||||
urlPrefix() {
|
||||
@@ -49,7 +46,6 @@ module('Unit | Mixin | build-url', function (hooks) {
|
||||
});
|
||||
|
||||
test('it can append a suffix', function (assert) {
|
||||
assert.expect(1);
|
||||
/* eslint-disable-next-line ember/no-new-mixins, ember/no-classic-classes */
|
||||
const Adapter = RESTAdapter.extend(AdapterBuildURLMixin, {
|
||||
urlSuffix() {
|
||||
|
||||
@@ -27,7 +27,6 @@ module('Unit | Model | account', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has an accountName attribute for password account', function (assert) {
|
||||
assert.expect(2);
|
||||
store = this.owner.lookup('service:store');
|
||||
let model = store.createRecord('account', {
|
||||
type: TYPE_AUTH_METHOD_PASSWORD,
|
||||
@@ -38,7 +37,6 @@ module('Unit | Model | account', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isPassword property and returns the expected values', function (assert) {
|
||||
assert.expect(3);
|
||||
const modelA = store.createRecord('account', {
|
||||
type: TYPE_AUTH_METHOD_PASSWORD,
|
||||
});
|
||||
@@ -54,7 +52,6 @@ module('Unit | Model | account', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isOIDC property and returns the expected values', function (assert) {
|
||||
assert.expect(3);
|
||||
const modelA = store.createRecord('account', {
|
||||
type: TYPE_AUTH_METHOD_OIDC,
|
||||
});
|
||||
@@ -70,7 +67,6 @@ module('Unit | Model | account', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isLDAP property and returns the expected values', function (assert) {
|
||||
assert.expect(3);
|
||||
const modelA = store.createRecord('account', {
|
||||
type: TYPE_AUTH_METHOD_LDAP,
|
||||
});
|
||||
@@ -86,7 +82,6 @@ module('Unit | Model | account', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isUnknown property and returns the expected values', function (assert) {
|
||||
assert.expect(4);
|
||||
const modelA = store.createRecord('account', {
|
||||
type: TYPE_AUTH_METHOD_LDAP,
|
||||
});
|
||||
|
||||
@@ -62,7 +62,6 @@ module('Unit | Model | auth method', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isPassword property and returns the expected values', function (assert) {
|
||||
assert.expect(3);
|
||||
const modelA = store.createRecord('auth-method', {
|
||||
type: TYPE_AUTH_METHOD_PASSWORD,
|
||||
});
|
||||
@@ -78,7 +77,6 @@ module('Unit | Model | auth method', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isOIDC property and returns the expected values', function (assert) {
|
||||
assert.expect(3);
|
||||
const modelA = store.createRecord('auth-method', {
|
||||
type: TYPE_AUTH_METHOD_OIDC,
|
||||
});
|
||||
@@ -94,7 +92,6 @@ module('Unit | Model | auth method', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isLDAP property and returns the expected values', function (assert) {
|
||||
assert.expect(3);
|
||||
const modelA = store.createRecord('auth-method', {
|
||||
type: TYPE_AUTH_METHOD_LDAP,
|
||||
});
|
||||
@@ -110,7 +107,6 @@ module('Unit | Model | auth method', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isUnknown property and returns the expected values', function (assert) {
|
||||
assert.expect(4);
|
||||
const modelA = store.createRecord('auth-method', {
|
||||
type: TYPE_AUTH_METHOD_LDAP,
|
||||
});
|
||||
|
||||
@@ -19,7 +19,6 @@ module('Unit | Model | base', function (hooks) {
|
||||
});
|
||||
|
||||
test('it may have a scope fragment (and thus a scopeModel)', function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
data: {
|
||||
@@ -46,7 +45,6 @@ module('Unit | Model | base', function (hooks) {
|
||||
});
|
||||
|
||||
test('it may accept a `scopeModel` for convenience, instead of a fragment', function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const scope = store.createRecord('scope', { id: 'o_1', type: 'org' });
|
||||
const model = store.createRecord('user', '123abc');
|
||||
@@ -57,7 +55,6 @@ module('Unit | Model | base', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has a displayName attribute', function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
data: {
|
||||
|
||||
@@ -17,7 +17,6 @@ module('Unit | Model | channel-recording', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isAsciicast property and returns the expected values', async function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('channel-recording', {
|
||||
mime_types: [MIME_TYPE_ASCIICAST],
|
||||
@@ -30,7 +29,6 @@ module('Unit | Model | channel-recording', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isAsciicast property and returns the expected values when mime_types are not present', async function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('channel-recording', {
|
||||
mime_types: undefined,
|
||||
|
||||
@@ -16,7 +16,6 @@ module('Unit | Model | connection-recording', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has channels as a relationship', async function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const model = store.createRecord('connection-recording', {
|
||||
channel_recordings: [store.createRecord('channel-recording')],
|
||||
|
||||
@@ -17,7 +17,6 @@ module('Unit | Model | credential library', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isUnknown property and returns the expected values', async function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('credential-library', {
|
||||
type: TYPE_CREDENTIAL_LIBRARY_VAULT_GENERIC,
|
||||
|
||||
@@ -16,7 +16,6 @@ module('Unit | Model | credential store', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has a `isStatic` computed property and returns the expected values', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelStatic = store.createRecord('credential-store', {
|
||||
type: 'static',
|
||||
@@ -30,7 +29,6 @@ module('Unit | Model | credential store', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has a `isVault` computed property and returns the expected values', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelVault = store.createRecord('credential-store', {
|
||||
type: 'vault',
|
||||
|
||||
@@ -16,7 +16,6 @@ module('Unit | Model | credential', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isStatic property and returns the expected values', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('credential', { id: 'credup_123' });
|
||||
const modelB = store.createRecord('credential', { id: 'credspk_123' });
|
||||
@@ -28,7 +27,6 @@ module('Unit | Model | credential', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isJSON property and returns the expected values', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('credential', { type: 'json' });
|
||||
const modelB = store.createRecord('credential', {
|
||||
@@ -44,7 +42,6 @@ module('Unit | Model | credential', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isUnknown property and returns the expected values', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('credential', {
|
||||
type: 'username_password',
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Unit | Model | group', function (hooks) {
|
||||
setupMirage(hooks);
|
||||
|
||||
test('it has a `members` array of resolved model instances (if those instances are already in the store)', function (assert) {
|
||||
assert.expect(4);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
data: {
|
||||
|
||||
@@ -16,7 +16,6 @@ module('Unit | Model | host catalog', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isStatic property and returns the expected values', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('host-catalog', { compositeType: 'aws' });
|
||||
const modelB = store.createRecord('host-catalog', {
|
||||
@@ -31,7 +30,6 @@ module('Unit | Model | host catalog', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isPlugin property and returns the expected values', async function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelPlugin = store.createRecord('host-catalog', {
|
||||
compositeType: 'aws',
|
||||
@@ -44,7 +42,6 @@ module('Unit | Model | host catalog', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isUnknown property and returns the expected values', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('host-catalog', {
|
||||
compositeType: 'static',
|
||||
@@ -59,7 +56,6 @@ module('Unit | Model | host catalog', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isAWS property and returns the expected values', async function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelAws = store.createRecord('host-catalog', {
|
||||
type: 'plugin',
|
||||
@@ -73,7 +69,6 @@ module('Unit | Model | host catalog', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isAzure property and return the expected values', async function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelAzure = store.createRecord('host-catalog', {
|
||||
type: 'plugin',
|
||||
@@ -87,7 +82,6 @@ module('Unit | Model | host catalog', function (hooks) {
|
||||
});
|
||||
|
||||
test('get compositeType returns expected values', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('host-catalog', {
|
||||
type: 'static',
|
||||
@@ -106,7 +100,6 @@ module('Unit | Model | host catalog', function (hooks) {
|
||||
});
|
||||
|
||||
test('set compositeType sets expected values', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelPlugin = store.createRecord('host-catalog', {
|
||||
compositeType: 'aws',
|
||||
|
||||
@@ -10,14 +10,12 @@ module('Unit | Model | host', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it exists', function (assert) {
|
||||
assert.expect(1);
|
||||
let store = this.owner.lookup('service:store');
|
||||
let model = store.createRecord('host', {});
|
||||
assert.ok(model);
|
||||
});
|
||||
|
||||
test('it contains attributes', function (assert) {
|
||||
assert.expect(1);
|
||||
let store = this.owner.lookup('service:store');
|
||||
let model = store.createRecord('host', {
|
||||
type: 'static',
|
||||
@@ -29,7 +27,6 @@ module('Unit | Model | host', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isStatic and returns the expected values', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('host', { type: 'static' });
|
||||
const modelB = store.createRecord('host', { type: 'plugin' });
|
||||
@@ -39,7 +36,6 @@ module('Unit | Model | host', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isPlugin and returns the expected values', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelPlugin = store.createRecord('host', { type: 'plugin' });
|
||||
const modelStatic = store.createRecord('host', { type: 'static' });
|
||||
@@ -49,7 +45,6 @@ module('Unit | Model | host', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isUnknown and returns the expected values', async function (assert) {
|
||||
assert.expect(4);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelAws = store.createRecord('host', {
|
||||
type: 'plugin',
|
||||
@@ -71,7 +66,6 @@ module('Unit | Model | host', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isAWS and returns the expected values', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelAws = store.createRecord('host', {
|
||||
type: 'plugin',
|
||||
@@ -86,7 +80,6 @@ module('Unit | Model | host', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isAzure and returns the expected values', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelAzure = store.createRecord('host', {
|
||||
type: 'plugin',
|
||||
@@ -101,7 +94,6 @@ module('Unit | Model | host', function (hooks) {
|
||||
});
|
||||
|
||||
test('get compositeType returns expected values', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelPlugin = store.createRecord('host', {
|
||||
type: 'plugin',
|
||||
@@ -116,7 +108,6 @@ module('Unit | Model | host', function (hooks) {
|
||||
});
|
||||
|
||||
test('set compositeType sets expected values', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelPlugin = store.createRecord('host', {
|
||||
compositeType: 'aws',
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Unit | Model | scope', function (hooks) {
|
||||
setupMirage(hooks);
|
||||
|
||||
test('it may have a scope fragment', async function (assert) {
|
||||
assert.expect(6);
|
||||
const store = this.owner.lookup('service:store');
|
||||
this.server.get('/v1/scopes', () => ({
|
||||
items: [
|
||||
@@ -55,7 +54,6 @@ module('Unit | Model | scope', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isType boolean getters and setters', async function (assert) {
|
||||
assert.expect(9);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const model = store.createRecord('scope', { type: 'global' });
|
||||
assert.ok(model.isGlobal);
|
||||
|
||||
@@ -24,7 +24,6 @@ module('Unit | Model | session-recording', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isUnknown property and returns the expected values', async function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('session-recording', {
|
||||
type: TYPE_SESSION_RECORDING_SSH,
|
||||
@@ -37,7 +36,6 @@ module('Unit | Model | session-recording', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isSSH property and returns the expected values', async function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('session-recording', {
|
||||
type: TYPE_SESSION_RECORDING_SSH,
|
||||
@@ -50,7 +48,6 @@ module('Unit | Model | session-recording', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isAvailable property and returns the expected values', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('session-recording', {
|
||||
state: STATE_SESSION_RECORDING_AVAILABLE,
|
||||
@@ -67,7 +64,6 @@ module('Unit | Model | session-recording', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has connections as a relationship', async function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const model = store.createRecord('session-recording', {
|
||||
type: TYPE_SESSION_RECORDING_SSH,
|
||||
@@ -79,7 +75,6 @@ module('Unit | Model | session-recording', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has targetScopeDisplayName and returns the expected values', async function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const fakeName = 'Scope name';
|
||||
const fakeId = 's_123456789';
|
||||
@@ -109,7 +104,6 @@ module('Unit | Model | session-recording', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has userDisplayName and returns the expected values', async function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const fakeUserName = 'User name';
|
||||
const fakeUserId = 'userid';
|
||||
|
||||
@@ -33,7 +33,6 @@ module('Unit | Model | session', function (hooks) {
|
||||
});
|
||||
|
||||
test('it computes isActive', function (assert) {
|
||||
assert.expect(2);
|
||||
let store = this.owner.lookup('service:store');
|
||||
let model = store.createRecord('session', {
|
||||
status: 'pending',
|
||||
@@ -44,7 +43,6 @@ module('Unit | Model | session', function (hooks) {
|
||||
});
|
||||
|
||||
test('it computes isPending', function (assert) {
|
||||
assert.expect(2);
|
||||
let store = this.owner.lookup('service:store');
|
||||
let model = store.createRecord('session', {
|
||||
status: 'active',
|
||||
@@ -66,7 +64,6 @@ module('Unit | Model | session', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isUnknownStatus property and returns the expected values', async function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('session', { status: 'active' });
|
||||
const modelB = store.createRecord('session', {
|
||||
|
||||
@@ -21,7 +21,6 @@ module('Unit | Model | storage bucket', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has the isPlugin property and returns the expected values', async function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelPlugin = store.createRecord('storage-bucket', {
|
||||
type: 'plugin',
|
||||
@@ -33,7 +32,6 @@ module('Unit | Model | storage bucket', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isUnknown property and returns the expected values', async function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('storage-bucket', {
|
||||
compositeType: TYPE_STORAGE_BUCKET_PLUGIN_AWS_S3,
|
||||
@@ -46,7 +44,6 @@ module('Unit | Model | storage bucket', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has credentialType property and returns the expected values', async function (assert) {
|
||||
assert.expect(4);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('storage-bucket', {
|
||||
role_arn: 'test-role-arn',
|
||||
@@ -73,7 +70,6 @@ module('Unit | Model | storage bucket', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isAWS property and returns the expected values', async function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelAws = store.createRecord('storage-bucket', {
|
||||
type: 'plugin',
|
||||
@@ -87,7 +83,6 @@ module('Unit | Model | storage bucket', function (hooks) {
|
||||
});
|
||||
|
||||
test('get compositeType returns expected values', async function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('storage-bucket', {
|
||||
type: 'plugin',
|
||||
@@ -102,7 +97,6 @@ module('Unit | Model | storage bucket', function (hooks) {
|
||||
});
|
||||
|
||||
test('set compositeType sets expected values', async function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelPlugin = store.createRecord('storage-bucket', {
|
||||
compositeType: TYPE_STORAGE_BUCKET_PLUGIN_AWS_S3,
|
||||
|
||||
@@ -13,7 +13,6 @@ module('Unit | Model | target', function (hooks) {
|
||||
setupMirage(hooks);
|
||||
|
||||
test('it has a `hostSets` array of resolved model instances (if those instances are already in the store)', function (assert) {
|
||||
assert.expect(6);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
data: {
|
||||
@@ -190,7 +189,6 @@ module('Unit | Model | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has a `sessions` array of session instances associated with the target (if those instances are already in the store)', function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
data: {
|
||||
@@ -234,7 +232,6 @@ module('Unit | Model | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has a `brokeredCredentialSources` array of resolved model instances (if those instances are already in the store)', function (assert) {
|
||||
assert.expect(4);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
data: {
|
||||
@@ -386,7 +383,6 @@ module('Unit | Model | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isSSH property and returns the expected values', function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelSSH = store.createRecord('target', {
|
||||
type: TYPE_TARGET_SSH,
|
||||
@@ -396,7 +392,6 @@ module('Unit | Model | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it has isTCP property and returns the expected values', function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelTCP = store.createRecord('target', {
|
||||
type: TYPE_TARGET_TCP,
|
||||
|
||||
@@ -105,7 +105,6 @@ module('Unit | Model | user', function (hooks) {
|
||||
});
|
||||
|
||||
test('it defaults `accounts_ids` to an empty array when model instance does not define it', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
data: {
|
||||
|
||||
@@ -13,7 +13,6 @@ module('Unit | Model | worker', function (hooks) {
|
||||
|
||||
test('it has a `createWorkerLed` method that targets a specific POST API', async function (assert) {
|
||||
assert.expect(2);
|
||||
|
||||
const scopeId = 'global';
|
||||
const workerGeneratedAuthToken = 'token';
|
||||
this.server.post('/v1/workers:create:worker-led', (schema, request) => {
|
||||
|
||||
@@ -15,7 +15,6 @@ module('Unit | Serializer | account', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it serializes OIDC-type with only issuer and subject in `attributes` on create', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('account');
|
||||
const record = store.createRecord('account', {
|
||||
@@ -45,7 +44,6 @@ module('Unit | Serializer | account', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes OIDC-type without `attributes` on update', function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('account');
|
||||
store.push({
|
||||
@@ -77,7 +75,6 @@ module('Unit | Serializer | account', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes password-type normally', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('account');
|
||||
const record = store.createRecord('account', {
|
||||
@@ -103,7 +100,6 @@ module('Unit | Serializer | account', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes password attribute when `adapterOptions.password` is true', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('account');
|
||||
const record = store.createRecord('account', {
|
||||
@@ -132,12 +128,7 @@ module('Unit | Serializer | account', function (hooks) {
|
||||
});
|
||||
});
|
||||
|
||||
test('it does not serialize password for non-new records', function (assert) {
|
||||
assert.expect(0);
|
||||
});
|
||||
|
||||
test('it serializes only password when `adapterOptions.method` is set to `set-password`', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('account');
|
||||
const record = store.createRecord('account', {
|
||||
@@ -161,7 +152,6 @@ module('Unit | Serializer | account', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes a custom payload when `adapterOptions.method` is set to `change-password`', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('account');
|
||||
const record = store.createRecord('account', {
|
||||
@@ -187,7 +177,6 @@ module('Unit | Serializer | account', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes LDAP-type with only login_name in `attributes` on create', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('account');
|
||||
const record = store.createRecord('account', {
|
||||
@@ -217,7 +206,6 @@ module('Unit | Serializer | account', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes LDAP-type without `attributes`', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('account');
|
||||
store.push({
|
||||
|
||||
@@ -11,14 +11,12 @@ module('Unit | Serializer | application', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it exists', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('application');
|
||||
assert.ok(serializer);
|
||||
});
|
||||
|
||||
test('it serializes records', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('user', {
|
||||
name: 'User',
|
||||
@@ -37,7 +35,6 @@ module('Unit | Serializer | application', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes scope_id', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('user', {
|
||||
name: 'User',
|
||||
@@ -56,7 +53,6 @@ module('Unit | Serializer | application', function (hooks) {
|
||||
});
|
||||
|
||||
test('it does not serialize scope_id when serializeScopeID is false', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('user');
|
||||
const record = store.createRecord('user', {
|
||||
@@ -77,7 +73,6 @@ module('Unit | Serializer | application', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes empty strings to null', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('user', {
|
||||
name: '',
|
||||
@@ -92,7 +87,6 @@ module('Unit | Serializer | application', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes non-nullish version fields', function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('user', {
|
||||
name: 'User',
|
||||
@@ -114,7 +108,6 @@ module('Unit | Serializer | application', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes secret attributes correctly', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('credential', {
|
||||
private_key_passphrase: undefined,
|
||||
@@ -141,7 +134,6 @@ module('Unit | Serializer | application', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes attributes with `for` option containing array or string correctly', function (assert) {
|
||||
assert.expect(1);
|
||||
let store = this.owner.lookup('service:store');
|
||||
let record = store.createRecord('auth-method', {
|
||||
type: TYPE_AUTH_METHOD_OIDC, //has both string and array `for` option
|
||||
@@ -193,7 +185,6 @@ module('Unit | Serializer | application', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes array records from an `items` root key', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('user');
|
||||
const userModelClass = store.createRecord('user').constructor;
|
||||
@@ -244,7 +235,6 @@ module('Unit | Serializer | application', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes single, unrooted records', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('user');
|
||||
const userModelClass = store.createRecord('user').constructor;
|
||||
@@ -275,7 +265,6 @@ module('Unit | Serializer | application', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes missing arrays in single responses if annotated in model attributes', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
const target = store.createRecord('target').constructor;
|
||||
@@ -308,7 +297,6 @@ module('Unit | Serializer | application', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes removed fields correctly', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('user');
|
||||
const user = store.createRecord('user').constructor;
|
||||
|
||||
@@ -25,7 +25,6 @@ module('Unit | Serializer | auth method', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes password records', function (assert) {
|
||||
assert.expect(2);
|
||||
let store = this.owner.lookup('service:store');
|
||||
let record = store.createRecord('auth-method', {
|
||||
type: TYPE_AUTH_METHOD_PASSWORD,
|
||||
@@ -41,7 +40,6 @@ module('Unit | Serializer | auth method', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes OIDC records without state', function (assert) {
|
||||
assert.expect(1);
|
||||
let store = this.owner.lookup('service:store');
|
||||
let record = store.createRecord('auth-method', {
|
||||
type: TYPE_AUTH_METHOD_OIDC,
|
||||
@@ -93,7 +91,6 @@ module('Unit | Serializer | auth method', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes LDAP records without state', function (assert) {
|
||||
assert.expect(1);
|
||||
let store = this.owner.lookup('service:store');
|
||||
let record = store.createRecord('auth-method', {
|
||||
type: TYPE_AUTH_METHOD_LDAP,
|
||||
@@ -158,7 +155,6 @@ module('Unit | Serializer | auth method', function (hooks) {
|
||||
});
|
||||
|
||||
test("OIDC auth-method doesn't serialize client secrets when not set", function (assert) {
|
||||
assert.expect(1);
|
||||
let store = this.owner.lookup('service:store');
|
||||
let record = store.createRecord('auth-method', {
|
||||
type: TYPE_AUTH_METHOD_OIDC,
|
||||
@@ -209,7 +205,6 @@ module('Unit | Serializer | auth method', function (hooks) {
|
||||
});
|
||||
|
||||
test("LDAP auth-method doesn't serialize client secrets when not set", function (assert) {
|
||||
assert.expect(1);
|
||||
let store = this.owner.lookup('service:store');
|
||||
let record = store.createRecord('auth-method', {
|
||||
type: TYPE_AUTH_METHOD_LDAP,
|
||||
@@ -273,7 +268,6 @@ module('Unit | Serializer | auth method', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes OIDC records with only state and version when `adapterOptions.state` is passed', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('auth-method');
|
||||
const record = store.createRecord('auth-method', {
|
||||
@@ -297,7 +291,6 @@ module('Unit | Serializer | auth method', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes LDAP records with only state and version when `adapterOptions.state` is passed', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('auth-method');
|
||||
const record = store.createRecord('auth-method', {
|
||||
@@ -321,7 +314,6 @@ module('Unit | Serializer | auth method', function (hooks) {
|
||||
});
|
||||
|
||||
test('it sorts primary first in normalizeArrayResponse', function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('auth-method');
|
||||
const modelClass = store.createRecord('auth-method').constructor;
|
||||
|
||||
@@ -14,7 +14,6 @@ module('Unit | Serializer | credential library', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it serializes correctly on create', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('credential-library');
|
||||
const record = store.createRecord('credential-library', {
|
||||
@@ -42,7 +41,6 @@ module('Unit | Serializer | credential library', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes correctly on update', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('credential-library');
|
||||
store.push({
|
||||
@@ -77,7 +75,6 @@ module('Unit | Serializer | credential library', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes empty strings to null', function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const vaultGenericRecord = store.createRecord('credential-library', {
|
||||
type: TYPE_CREDENTIAL_LIBRARY_VAULT_GENERIC,
|
||||
@@ -122,7 +119,6 @@ module('Unit | Serializer | credential library', function (hooks) {
|
||||
});
|
||||
|
||||
test('it does not serialize http_request_body unless http_method is set to POST', function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('credential-library', {
|
||||
type: TYPE_CREDENTIAL_LIBRARY_VAULT_GENERIC,
|
||||
@@ -166,7 +162,6 @@ module('Unit | Serializer | credential library', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes vault_ssh_certificate correctly', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('credential-library');
|
||||
store.push({
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Serializer | credential store', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it serializes vault-type correctly on create', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('credential-store');
|
||||
const record = store.createRecord('credential-store', {
|
||||
@@ -50,7 +49,6 @@ module('Unit | Serializer | credential store', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes vault-type correctly on update', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('credential-store');
|
||||
store.push({
|
||||
@@ -97,7 +95,6 @@ module('Unit | Serializer | credential store', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes empty strings to null for vault-type credential store', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('credential-store', {
|
||||
address: '',
|
||||
@@ -129,7 +126,6 @@ module('Unit | Serializer | credential store', function (hooks) {
|
||||
});
|
||||
|
||||
test('it does not serialize token if present but falsy for vault-type credential store', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('credential-store', {
|
||||
token: null,
|
||||
@@ -166,7 +162,6 @@ module('Unit | Serializer | credential store', function (hooks) {
|
||||
});
|
||||
|
||||
test('it does not serialize client certificate key if present but falsy when client certificate is present for vault-type credential store', function (assert) {
|
||||
assert.expect(2);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('credential-store', {
|
||||
client_certificate: 'client-cert-123',
|
||||
@@ -226,7 +221,6 @@ module('Unit | Serializer | credential store', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes empty strings to null for static-type credential store', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('credential-store', {
|
||||
name: '',
|
||||
@@ -242,7 +236,6 @@ module('Unit | Serializer | credential store', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes static-type correctly on create', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('credential-store', {
|
||||
type: 'static',
|
||||
@@ -257,7 +250,6 @@ module('Unit | Serializer | credential store', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes static-type correctly on update', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
data: {
|
||||
@@ -280,7 +272,6 @@ module('Unit | Serializer | credential store', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes vault type credential store record', async function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('credential-store');
|
||||
const credentialStoreModelClass =
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Serializer | credential', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it serializes username_password type correctly on create', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('credential');
|
||||
const record = store.createRecord('credential', {
|
||||
@@ -39,7 +38,6 @@ module('Unit | Serializer | credential', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes username_password type correctly when only the username is updated', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('credential');
|
||||
const record = store.createRecord('credential', {
|
||||
@@ -67,7 +65,6 @@ module('Unit | Serializer | credential', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes ssh_private_key type correctly on create', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('credential');
|
||||
const record = store.createRecord('credential', {
|
||||
@@ -98,7 +95,6 @@ module('Unit | Serializer | credential', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes json_object type correctly on create', async function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('credential');
|
||||
const record = store.createRecord('credential', {
|
||||
@@ -129,7 +125,6 @@ module('Unit | Serializer | credential', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes ssh_private_key type correctly when only the username is updated', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('credential');
|
||||
const record = store.createRecord('credential', {
|
||||
@@ -158,7 +153,6 @@ module('Unit | Serializer | credential', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes username_password type correctly by removing "json_object" attribute', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('credential');
|
||||
const record = store.createRecord('credential', {
|
||||
@@ -187,7 +181,6 @@ module('Unit | Serializer | credential', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes ssh_private_key type correctly by removing "json_object" attribute', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('credential');
|
||||
const record = store.createRecord('credential', {
|
||||
@@ -219,7 +212,6 @@ module('Unit | Serializer | credential', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes "username_password" type credential record', async function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('credential');
|
||||
const credentialModelClass = store.createRecord('credential').constructor;
|
||||
@@ -253,7 +245,6 @@ module('Unit | Serializer | credential', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes "ssh_private_key" type credential record', async function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('credential');
|
||||
const credentialModelClass = store.createRecord('credential').constructor;
|
||||
@@ -288,7 +279,6 @@ module('Unit | Serializer | credential', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes "json" type credential record', async function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('credential');
|
||||
const credentialModelClass = store.createRecord('credential').constructor;
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Serializer | group', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it serializes groups normally, without members', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('group');
|
||||
const record = store.createRecord('group', {
|
||||
@@ -30,7 +29,6 @@ module('Unit | Serializer | group', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes only host sets and version when an `adapterOptions.memberIDs` array is passed', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('group');
|
||||
const record = store.createRecord('group', {
|
||||
@@ -51,7 +49,6 @@ module('Unit | Serializer | group', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes missing member_ids to empty array', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('group');
|
||||
const group = store.createRecord('group').constructor;
|
||||
|
||||
@@ -17,7 +17,6 @@ module('Unit | Serializer | host catalog', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes a static host-catalog as expected', async function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('host-catalog', {
|
||||
name: 'static',
|
||||
@@ -33,7 +32,6 @@ module('Unit | Serializer | host catalog', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes a new aws plugin as expected, ignoring azure fields', async function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('host-catalog', {
|
||||
compositeType: 'aws',
|
||||
@@ -68,7 +66,6 @@ module('Unit | Serializer | host catalog', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes a new azure record as expected, ignoring aws fields', async function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('host-catalog', {
|
||||
compositeType: 'azure',
|
||||
@@ -104,7 +101,6 @@ module('Unit | Serializer | host catalog', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes an existing aws record correctly', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
data: {
|
||||
@@ -135,7 +131,6 @@ module('Unit | Serializer | host catalog', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes an existing azure record correctly', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
data: {
|
||||
@@ -170,7 +165,6 @@ module('Unit | Serializer | host catalog', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes an static host catalog as expected', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('host-catalog');
|
||||
const hostCatalog = store.createRecord('host-catalog').constructor;
|
||||
@@ -207,7 +201,6 @@ module('Unit | Serializer | host catalog', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes an aws plugin type host catalog as expected', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('host-catalog');
|
||||
const hostCatalog = store.createRecord('host-catalog').constructor;
|
||||
@@ -264,7 +257,6 @@ module('Unit | Serializer | host catalog', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes an azure plugin type host catalog as expected', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('host-catalog');
|
||||
const hostCatalog = store.createRecord('host-catalog').constructor;
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Serializer | host set', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it serializes host sets normally, without host_ids', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('host-set', {
|
||||
name: 'Host Set 1',
|
||||
@@ -28,7 +27,6 @@ module('Unit | Serializer | host set', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes only host_ids when `adapterOptions.hostIDs` is true', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('host-set');
|
||||
const record = store.createRecord('host-set', {
|
||||
@@ -49,7 +47,6 @@ module('Unit | Serializer | host set', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes host sets as expected for Aws plugin', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('host-set', {
|
||||
name: 'Host Set 1',
|
||||
@@ -75,7 +72,6 @@ module('Unit | Serializer | host set', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes host sets as expected for Azure plugin', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('host-set', {
|
||||
name: 'Host Set 1',
|
||||
@@ -101,7 +97,6 @@ module('Unit | Serializer | host set', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes records with array fields', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('host-set');
|
||||
const hostSetModelClass = store.createRecord('host-set').constructor;
|
||||
@@ -141,7 +136,6 @@ module('Unit | Serializer | host set', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes missing array fields to empty array', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('host-set');
|
||||
const hostSet = store.createRecord('host-set').constructor;
|
||||
@@ -174,7 +168,6 @@ module('Unit | Serializer | host set', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes filter correctly', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('host-set');
|
||||
const hostSetModelClass = store.createRecord('host-set').constructor;
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Serializer | host', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it serializes host with type static as expected', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('host', {
|
||||
name: 'Host 1',
|
||||
@@ -33,7 +32,6 @@ module('Unit | Serializer | host', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes type static record as expected', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('host');
|
||||
const host = store.createRecord('host').constructor;
|
||||
@@ -65,7 +63,6 @@ module('Unit | Serializer | host', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes type plugin (aws) record as expected', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('host');
|
||||
const host = store.createRecord('host').constructor;
|
||||
|
||||
@@ -14,7 +14,6 @@ module('Unit | Serializer | Managed group', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it serializes correctly on create with no filter provided', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('managed-group');
|
||||
const record = store.createRecord('managed-group', {
|
||||
@@ -38,7 +37,6 @@ module('Unit | Serializer | Managed group', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes correctly on create when filter provided', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('managed-group');
|
||||
const record = store.createRecord('managed-group', {
|
||||
@@ -66,7 +64,6 @@ module('Unit | Serializer | Managed group', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes correctly on create when group names are provided', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('managed-group');
|
||||
const record = store.createRecord('managed-group', {
|
||||
@@ -94,7 +91,6 @@ module('Unit | Serializer | Managed group', function (hooks) {
|
||||
});
|
||||
|
||||
test('it does not serialize version when it has null or undefined value', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('managed-group');
|
||||
store.push({
|
||||
@@ -127,7 +123,6 @@ module('Unit | Serializer | Managed group', function (hooks) {
|
||||
});
|
||||
|
||||
test('it does not serialize readOnly attributes', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('managed-group');
|
||||
const record = store.createRecord('managed-group', {
|
||||
@@ -153,7 +148,6 @@ module('Unit | Serializer | Managed group', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes correctly on update', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('managed-group');
|
||||
store.push({
|
||||
@@ -187,7 +181,6 @@ module('Unit | Serializer | Managed group', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes correctly', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('managed-group');
|
||||
const hostSetModelClass = store.createRecord('managed-group').constructor;
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Serializer | role', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it serializes roles normally, without grants', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('role');
|
||||
const record = store.createRecord('role', {
|
||||
@@ -31,7 +30,6 @@ module('Unit | Serializer | role', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes only grant strings when `adapterOptions.grantStrings` is set', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('role');
|
||||
const record = store.createRecord('role', {
|
||||
@@ -52,7 +50,6 @@ module('Unit | Serializer | role', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes records with array fields', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('role');
|
||||
const roleModelClass = store.createRecord('role').constructor;
|
||||
@@ -83,7 +80,6 @@ module('Unit | Serializer | role', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes missing principals to empty array', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('role');
|
||||
const role = store.createRecord('role').constructor;
|
||||
|
||||
@@ -17,7 +17,6 @@ module('Unit | Serializer | session', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes only version when `adapterOptions.method` is `cancel`', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('session');
|
||||
const record = store.createRecord('session', {
|
||||
|
||||
@@ -25,7 +25,6 @@ module('Unit | Serializer | storage bucket', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes a new static aws plugin as expected', async function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('storage-bucket', {
|
||||
compositeType: TYPE_STORAGE_BUCKET_PLUGIN_AWS_S3,
|
||||
@@ -72,7 +71,6 @@ module('Unit | Serializer | storage bucket', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes a new aws plugin with dynamic credentials as expected', async function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const record = store.createRecord('storage-bucket', {
|
||||
compositeType: TYPE_STORAGE_BUCKET_PLUGIN_AWS_S3,
|
||||
@@ -115,7 +113,6 @@ module('Unit | Serializer | storage bucket', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes when updating a dynamic type credential storage bucket with static credentials correctly', async function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('storage-bucket');
|
||||
store.push({
|
||||
@@ -173,7 +170,6 @@ module('Unit | Serializer | storage bucket', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes when updating a static type credential storage bucket with dynamic credentials correctly', async function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('storage-bucket');
|
||||
store.push({
|
||||
@@ -227,7 +223,6 @@ module('Unit | Serializer | storage bucket', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes correctly', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('storage-bucket');
|
||||
const hostSetModelClass = store.createRecord('storage-bucket').constructor;
|
||||
|
||||
@@ -11,7 +11,6 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it serializes TCP targets normally, without host sets or credential libraries or session recording fields in the attributes', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
const record = store.createRecord('target', {
|
||||
@@ -61,7 +60,6 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes SSH targets normally with session recording fields in the attributes but without host sets or credential libraries', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
const record = store.createRecord('target', {
|
||||
@@ -113,7 +111,6 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes only host sources and version when an `adapterOptions.hostSetIDs` array is passed', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
const record = store.createRecord('target', {
|
||||
@@ -137,7 +134,6 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes only credential sources and version when an `adapterOptions.brokeredCredentialSourceIDs` array is passed', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
const record = store.createRecord('target', {
|
||||
@@ -159,7 +155,6 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes only credential sources and version when an `adapterOptions.injectedApplicationCredentialSourceIDs` array is passed', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
const record = store.createRecord('target', {
|
||||
@@ -184,7 +179,6 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes the storage_bucket_id attribute if present', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
const record = store.createRecord('target', {
|
||||
@@ -223,7 +217,6 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes the worker_filter attribute if present', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
const record = store.createRecord('target', {
|
||||
@@ -261,7 +254,6 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes the egress_worker_filter attribute if present', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
const record = store.createRecord('target', {
|
||||
@@ -299,7 +291,6 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes the ingress_worker_filter attribute if present', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
const record = store.createRecord('target', {
|
||||
@@ -337,7 +328,6 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes records with array fields', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
const targetModelClass = store.createRecord('target').constructor;
|
||||
@@ -377,7 +367,6 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes records with nested attributes', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
const targetModelClass = store.createRecord('target').constructor;
|
||||
@@ -412,7 +401,6 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes missing host_sources and brokered_credential_source_ids to empty array', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
const target = store.createRecord('target').constructor;
|
||||
@@ -445,7 +433,6 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes the worker_filter attribute if present', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
const target = store.createRecord('target').constructor;
|
||||
@@ -478,7 +465,6 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes the egress_worker_filter attribute if present', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
const target = store.createRecord('target').constructor;
|
||||
@@ -511,7 +497,6 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes the ingress_worker_filter attribute if present', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
const target = store.createRecord('target').constructor;
|
||||
@@ -544,7 +529,6 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes the storage_bucket_id attribute if present', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
const target = store.createRecord('target').constructor;
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Serializer | user', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it serializes users normally, without accounts', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('user');
|
||||
const record = store.createRecord('user', {
|
||||
@@ -30,7 +29,6 @@ module('Unit | Serializer | user', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes only host sets and version when an `adapterOptions.accountIDs` array is passed', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('user');
|
||||
const record = store.createRecord('user', {
|
||||
@@ -51,7 +49,6 @@ module('Unit | Serializer | user', function (hooks) {
|
||||
});
|
||||
|
||||
test('it normalizes missing account_ids to empty array', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('user');
|
||||
const user = store.createRecord('user').constructor;
|
||||
|
||||
@@ -10,14 +10,12 @@ module('Unit | Service | storage', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it can persist values', function (assert) {
|
||||
assert.expect(1);
|
||||
const service = this.owner.lookup('service:storage');
|
||||
service.setItem('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.strictEqual(service.getItem('foo'), 'bar');
|
||||
@@ -29,14 +27,12 @@ module('Unit | Service | storage', function (hooks) {
|
||||
// if we switch to random test ordering
|
||||
|
||||
test("it's in-memory storage is implicitly refreshed for every test case", function (assert) {
|
||||
assert.expect(1);
|
||||
const service = this.owner.lookup('service:storage');
|
||||
service.setItem('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) {
|
||||
assert.expect(1);
|
||||
const service = this.owner.lookup('service:storage');
|
||||
assert.notOk(service.getItem('foo'));
|
||||
});
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Transform | account value map array', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it deserializes an array of account claims', function (assert) {
|
||||
assert.expect(1);
|
||||
const transform = this.owner.lookup('transform:account-value-map-array');
|
||||
const deserialized = transform.deserialize(['oid=sub', 'full_name=name']);
|
||||
assert.deepEqual(deserialized, [
|
||||
@@ -20,7 +19,6 @@ module('Unit | Transform | account value map array', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes an array of account claims', function (assert) {
|
||||
assert.expect(1);
|
||||
const transform = this.owner.lookup('transform:account-value-map-array');
|
||||
const serialized = transform.serialize([
|
||||
{ from: 'oid', to: 'sub' },
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Transform | duration', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it deserializes a duration string', function (assert) {
|
||||
assert.expect(8);
|
||||
const transform = this.owner.lookup('transform:duration');
|
||||
|
||||
const num1 = transform.deserialize('0s');
|
||||
@@ -33,7 +32,6 @@ module('Unit | Transform | duration', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes a duration number', function (assert) {
|
||||
assert.expect(7);
|
||||
const transform = this.owner.lookup('transform:duration');
|
||||
const num1 = transform.serialize(0);
|
||||
const num2 = transform.serialize(undefined);
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Transform | host source id array', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it deserializes an array of strings to an array of `{value}`', function (assert) {
|
||||
assert.expect(1);
|
||||
const transform = this.owner.lookup('transform:host-source-id-array');
|
||||
const deserialized = transform.deserialize([
|
||||
{ id: '123', host_catalog_id: '1' },
|
||||
@@ -21,7 +20,6 @@ module('Unit | Transform | host source id array', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes an array of `{value}` to an array of strings', function (assert) {
|
||||
assert.expect(1);
|
||||
const transform = this.owner.lookup('transform:host-source-id-array');
|
||||
const serialized = transform.serialize([
|
||||
{ host_source_id: '123', host_catalog_id: '1' },
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Transform | object as array', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it deserializes an object to an array of key value objects', function (assert) {
|
||||
assert.expect(1);
|
||||
let transform = this.owner.lookup('transform:object-as-array');
|
||||
const deserialized = transform.deserialize({
|
||||
first: 'Hey',
|
||||
@@ -25,14 +24,12 @@ module('Unit | Transform | object as array', function (hooks) {
|
||||
});
|
||||
|
||||
test('it deserializes undefined to an empty object', function (assert) {
|
||||
assert.expect(1);
|
||||
let transform = this.owner.lookup('transform:object-as-array');
|
||||
const deserialized = transform.deserialize(undefined);
|
||||
assert.deepEqual(deserialized, []);
|
||||
});
|
||||
|
||||
test('it serializes an array of key value objects to an object', function (assert) {
|
||||
assert.expect(1);
|
||||
let transform = this.owner.lookup('transform:object-as-array');
|
||||
const serialized = transform.serialize([
|
||||
{ key: 'first', value: 'Hey' },
|
||||
@@ -48,7 +45,6 @@ module('Unit | Transform | object as array', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes an empty array of key value objects to null', function (assert) {
|
||||
assert.expect(1);
|
||||
let transform = this.owner.lookup('transform:object-as-array');
|
||||
const serialized = transform.serialize([]);
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Transform | string array', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it deserializes an array of strings to an array of `{value}`', function (assert) {
|
||||
assert.expect(1);
|
||||
const transform = this.owner.lookup('transform:string-array');
|
||||
const deserialized = transform.deserialize(['a', 'bee', 'Hello World']);
|
||||
assert.deepEqual(deserialized, [
|
||||
@@ -21,14 +20,12 @@ module('Unit | Transform | string array', function (hooks) {
|
||||
});
|
||||
|
||||
test('it deserializes null to an empty array', function (assert) {
|
||||
assert.expect(1);
|
||||
const transform = this.owner.lookup('transform:string-array');
|
||||
const deserialized = transform.deserialize(null);
|
||||
assert.deepEqual(deserialized, []);
|
||||
});
|
||||
|
||||
test('it serializes an array of `{value}` to an array of strings', function (assert) {
|
||||
assert.expect(1);
|
||||
const transform = this.owner.lookup('transform:string-array');
|
||||
const serialized = transform.serialize([
|
||||
{ value: 'a' },
|
||||
@@ -39,7 +36,6 @@ module('Unit | Transform | string array', function (hooks) {
|
||||
});
|
||||
|
||||
test('it serializes null to an empty array', function (assert) {
|
||||
assert.expect(1);
|
||||
const transform = this.owner.lookup('transform:string-array');
|
||||
const serialized = transform.serialize(null);
|
||||
assert.deepEqual(serialized, []);
|
||||
|
||||
@@ -59,6 +59,9 @@ module.exports = {
|
||||
// Test files:
|
||||
files: ['tests/**/*-test.{js,ts}'],
|
||||
extends: ['plugin:qunit/recommended'],
|
||||
rules: {
|
||||
'qunit/require-expect': [2, 'except-simple'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -58,7 +58,7 @@
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-ember": "^11.11.1",
|
||||
"eslint-plugin-n": "^16.3.1",
|
||||
"eslint-plugin-qunit": "^7.3.4",
|
||||
"eslint-plugin-qunit": "^8.0.1",
|
||||
"loader.js": "^4.7.0",
|
||||
"pretender": "^3.4.3",
|
||||
"prettier": "^3.0.0",
|
||||
|
||||
@@ -21,7 +21,6 @@ module('Unit | Authenticator | OIDC', function (hooks) {
|
||||
});
|
||||
|
||||
test('`startAuthentication` initiates the authentication flow and returns the response', async function (assert) {
|
||||
assert.expect(2);
|
||||
const authenticator = this.owner.lookup('authenticator:oidc');
|
||||
server.post(authenticator.buildAuthEndpointURL(), () => [
|
||||
200,
|
||||
|
||||
@@ -21,7 +21,6 @@ module('Unit | Session Store | cookie', function (hooks) {
|
||||
});
|
||||
|
||||
test('it restores a session if both necessary cookies are present (session exists)', async function (assert) {
|
||||
assert.expect(2);
|
||||
sessionStore.cookies.write(sessionStore.cookieName, 'token-value', {
|
||||
path: '/',
|
||||
});
|
||||
@@ -40,14 +39,12 @@ module('Unit | Session Store | cookie', function (hooks) {
|
||||
});
|
||||
|
||||
test('it rejects restore if the session does not exist', async function (assert) {
|
||||
assert.expect(2);
|
||||
assert.notOk(sessionStore.sessionExists);
|
||||
await sessionStore.restore().catch(() => {});
|
||||
assert.ok(true, 'Rejected');
|
||||
});
|
||||
|
||||
test('it cleans up cookies on restore rejection', async function (assert) {
|
||||
assert.expect(4);
|
||||
// For session cookie
|
||||
sessionStore.cookies.write(sessionStore.cookieName, 'token-value', {
|
||||
path: '/',
|
||||
@@ -79,7 +76,6 @@ module('Unit | Session Store | cookie', function (hooks) {
|
||||
});
|
||||
|
||||
test('it persists only an authenticator name cookie, since the server persists the session cookie', async function (assert) {
|
||||
assert.expect(4);
|
||||
assert.notOk(sessionStore.cookies.exists(sessionStore.cookieName));
|
||||
assert.notOk(
|
||||
sessionStore.cookies.exists(sessionStore.authenticatorCookieName),
|
||||
|
||||
@@ -59,6 +59,9 @@ module.exports = {
|
||||
// Test files:
|
||||
files: ['tests/**/*-test.{js,ts}'],
|
||||
extends: ['plugin:qunit/recommended'],
|
||||
rules: {
|
||||
'qunit/require-expect': [2, 'except-simple'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -75,7 +75,7 @@
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-ember": "^11.11.1",
|
||||
"eslint-plugin-n": "^16.3.1",
|
||||
"eslint-plugin-qunit": "^7.3.4",
|
||||
"eslint-plugin-qunit": "^8.0.1",
|
||||
"js-bexpr": "hashicorp/js-bexpr#9b4a4b54d85eba67fdfc0990133d1518d890b1e1",
|
||||
"loader.js": "^4.7.0",
|
||||
"prettier": "^3.0.0",
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Component | doc-link', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(1);
|
||||
await render(hbs`<DocLink @doc='account' @iconSize='large' />`);
|
||||
assert.ok(find('.doc-link .rose-icon.large'));
|
||||
});
|
||||
|
||||
@@ -19,8 +19,6 @@ module('Integration | Component | form | authenticate', function (hooks) {
|
||||
setupIntl(hooks);
|
||||
|
||||
test('it shows login name and password when LDAP is selected from the list', async function (assert) {
|
||||
assert.expect(3);
|
||||
|
||||
const store = this.owner.lookup('service:store');
|
||||
|
||||
this.model = store.createRecord('auth-method', {
|
||||
@@ -43,8 +41,6 @@ module('Integration | Component | form | authenticate', function (hooks) {
|
||||
});
|
||||
|
||||
test('it shows login name and password when password is selected from the list', async function (assert) {
|
||||
assert.expect(3);
|
||||
|
||||
const store = this.owner.lookup('service:store');
|
||||
|
||||
this.model = store.createRecord('auth-method', {
|
||||
@@ -67,8 +63,6 @@ module('Integration | Component | form | authenticate', function (hooks) {
|
||||
});
|
||||
|
||||
test('it should only show sign in button when OIDC is selected from the list', async function (assert) {
|
||||
assert.expect(3);
|
||||
|
||||
const store = this.owner.lookup('service:store');
|
||||
|
||||
this.model = store.createRecord('auth-method', {
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Component | Image', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(1);
|
||||
await render(hbs`<Image @name='logo-app' />`);
|
||||
assert.ok(find('.image-container'));
|
||||
});
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Component | pending-confirmations', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders pending confirmations', async function (assert) {
|
||||
assert.expect(2);
|
||||
const service = this.owner.lookup('service:confirm');
|
||||
service.enabled = true;
|
||||
await render(hbs`<PendingConfirmations as |confirmation|>
|
||||
|
||||
@@ -10,8 +10,8 @@ import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | session-status', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it maps to correct text color, icon and type if it is in active status', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
this.model = store.createRecord('session', { status: 'active' });
|
||||
await render(hbs`<SessionStatus @model={{this.model}} />`);
|
||||
@@ -21,7 +21,6 @@ module('Integration | Component | session-status', function (hooks) {
|
||||
});
|
||||
|
||||
test('it maps to correct text color, icon and type if it is in canceling status', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
this.model = store.createRecord('session', { status: 'canceling' });
|
||||
await render(hbs`<SessionStatus @model={{this.model}} />`);
|
||||
@@ -31,7 +30,6 @@ module('Integration | Component | session-status', function (hooks) {
|
||||
});
|
||||
|
||||
test('it maps to correct text color, icon and type if it is in terminated status', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
this.model = store.createRecord('session', { status: 'terminated' });
|
||||
await render(hbs`<SessionStatus @model={{this.model}} />`);
|
||||
@@ -41,7 +39,6 @@ module('Integration | Component | session-status', function (hooks) {
|
||||
});
|
||||
|
||||
test('it maps to correct text color, icon and type if it is in pending status', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
this.model = store.createRecord('session', { status: 'pending' });
|
||||
await render(hbs`<SessionStatus @model={{this.model}} />`);
|
||||
@@ -51,7 +48,6 @@ module('Integration | Component | session-status', function (hooks) {
|
||||
});
|
||||
|
||||
test('display neutral color and outlined style when it is an unknown status', async function (assert) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
this.model = store.createRecord('session', { status: 'any string' });
|
||||
await render(hbs`<SessionStatus @model={{this.model}} />`);
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Helper | app-name', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(1);
|
||||
await render(hbs`{{app-name}}`);
|
||||
assert.strictEqual(this.element.textContent.trim(), 'App Name');
|
||||
});
|
||||
|
||||
@@ -7,7 +7,6 @@ module('Integration | Helper | company-copyright', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(1);
|
||||
const currentYear = new Date().getFullYear();
|
||||
await render(hbs`{{company-copyright}}`);
|
||||
assert.strictEqual(
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Helper | company-name', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(1);
|
||||
await render(hbs`{{company-name}}`);
|
||||
assert.strictEqual(this.element.textContent.trim(), 'Company Name');
|
||||
});
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Helper | doc-url', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders a URL generated from the documentation config', async function (assert) {
|
||||
assert.expect(3);
|
||||
const config = this.owner.resolveRegistration('config:environment');
|
||||
const baseURL = config.documentation.baseURL;
|
||||
const path = config.documentation.topics.account;
|
||||
@@ -23,7 +22,6 @@ module('Integration | Helper | doc-url', function (hooks) {
|
||||
});
|
||||
|
||||
test('it throws an error if the specified documentation path cannot be found', async function (assert) {
|
||||
assert.expect(2);
|
||||
const Helper = this.owner.lookup('helper:doc-url');
|
||||
const helper = new Helper(this.owner);
|
||||
assert.ok(helper.compute(['account']), 'Specified document exists.');
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Helper | format-bytes-size', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders file size in human-readable string', async function (assert) {
|
||||
assert.expect(18);
|
||||
// Size to B
|
||||
const expectedSizeB = '1 B';
|
||||
this.set('inputNumberSizeB', 1);
|
||||
|
||||
@@ -16,8 +16,6 @@ module('Integration | Helper | relative-datetime-live', function (hooks) {
|
||||
let now;
|
||||
|
||||
test('it renders relative date in "time" ago format', async function (assert) {
|
||||
assert.expect(8);
|
||||
|
||||
now = Date.now();
|
||||
this.date = now - 100 - 30 * 1000;
|
||||
await render(hbs`{{relative-datetime-live this.date}}`);
|
||||
@@ -60,8 +58,6 @@ module('Integration | Helper | relative-datetime-live', function (hooks) {
|
||||
});
|
||||
|
||||
test('it renders nothing when there is no date', async function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
this.date = null;
|
||||
await render(hbs`{{relative-datetime-live this.date}}`);
|
||||
assert.dom(this.element).hasText('');
|
||||
|
||||
@@ -25,7 +25,6 @@ module('Integration | Helper | truncate-list', function (hooks) {
|
||||
setupIntl(hooks);
|
||||
|
||||
test('it renders correctly when there is list with more than the limit specificed', async function (assert) {
|
||||
assert.expect(1);
|
||||
this.set('inputValue', list);
|
||||
this.set('limit', limit);
|
||||
await render(
|
||||
@@ -38,7 +37,6 @@ module('Integration | Helper | truncate-list', function (hooks) {
|
||||
});
|
||||
|
||||
test('it renders correctly when there is list with one item', async function (assert) {
|
||||
assert.expect(1);
|
||||
this.set('inputValue', listWithOneItem);
|
||||
|
||||
await render(hbs`{{truncate-list 'actions.more' this.inputValue}}`);
|
||||
@@ -46,7 +44,6 @@ module('Integration | Helper | truncate-list', function (hooks) {
|
||||
});
|
||||
|
||||
test('it renders correctly when the list is empty', async function (assert) {
|
||||
assert.expect(1);
|
||||
this.set('inputValue', listWithNoItem);
|
||||
|
||||
await render(hbs`{{truncate-list 'actions.more' this.inputValue}}`);
|
||||
|
||||
@@ -30,7 +30,6 @@ module('Unit | Authenticator | password', function (hooks) {
|
||||
});
|
||||
|
||||
test('it adds an authorization header to application adapter on restore', async function (assert) {
|
||||
assert.expect(1);
|
||||
const id = 'token1234';
|
||||
const mockData = { attributes: { id, token: 'token1234' } };
|
||||
this.server.get(authenticator.buildTokenValidationEndpointURL(id), () => {
|
||||
@@ -44,7 +43,6 @@ module('Unit | Authenticator | password', function (hooks) {
|
||||
});
|
||||
|
||||
test('it adds an authorization header to application adapter on authenticate', async function (assert) {
|
||||
assert.expect(1);
|
||||
const creds = { identification: 'foo', password: 'bar' };
|
||||
const scope = { id: 'global' };
|
||||
const authMethod = { id: 'paum_1234' };
|
||||
|
||||
@@ -10,7 +10,6 @@ module('Unit | Service | confirm', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('`confirm()` emits promise-like instances', function (assert) {
|
||||
assert.expect(3);
|
||||
const service = this.owner.lookup('service:confirm');
|
||||
service.enabled = true;
|
||||
const confirmation = service.confirm();
|
||||
@@ -20,7 +19,6 @@ module('Unit | Service | confirm', function (hooks) {
|
||||
});
|
||||
|
||||
test('`pending` is an array of pending confirmations', function (assert) {
|
||||
assert.expect(3);
|
||||
const service = this.owner.lookup('service:confirm');
|
||||
service.enabled = true;
|
||||
assert.strictEqual(
|
||||
@@ -39,7 +37,6 @@ module('Unit | Service | confirm', function (hooks) {
|
||||
});
|
||||
|
||||
test('confirmations may be confirmed or dismissed', function (assert) {
|
||||
assert.expect(4);
|
||||
const service = this.owner.lookup('service:confirm');
|
||||
service.enabled = true;
|
||||
let confirmation = service.confirm();
|
||||
|
||||
@@ -68,6 +68,9 @@ module.exports = {
|
||||
// Test files:
|
||||
files: ['tests/**/*-test.{js,ts}'],
|
||||
extends: ['plugin:qunit/recommended'],
|
||||
rules: {
|
||||
'qunit/require-expect': [2, 'except-simple'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -84,7 +84,7 @@
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-ember": "^11.11.1",
|
||||
"eslint-plugin-n": "^16.3.1",
|
||||
"eslint-plugin-qunit": "^7.3.4",
|
||||
"eslint-plugin-qunit": "^8.0.1",
|
||||
"jest": "^27.4.7",
|
||||
"loader.js": "^4.7.0",
|
||||
"postcss": "^8.4.31",
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Component | rose/cards', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(2);
|
||||
await render(hbs`
|
||||
<Rose::Cards as |cards|>
|
||||
<cards.link
|
||||
|
||||
@@ -12,8 +12,6 @@ module('Integration | Component | rose/dialog/cover', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(3);
|
||||
|
||||
await render(hbs`
|
||||
<Rose::Dialog::Cover>
|
||||
<:header>
|
||||
|
||||
@@ -34,7 +34,6 @@ module('Integration | Component | rose/form', function (hooks) {
|
||||
});
|
||||
|
||||
test('it can render contextual form components', async function (assert) {
|
||||
assert.expect(5);
|
||||
this.submit = () => {};
|
||||
this.cancel = () => {};
|
||||
this.select = () => {};
|
||||
@@ -46,9 +45,9 @@ module('Integration | Component | rose/form', function (hooks) {
|
||||
as |form|
|
||||
>
|
||||
<form.input @label="Input" @name="input-field" />
|
||||
<Hds::Form::Textarea::Field
|
||||
@value="This is my description"
|
||||
name="textarea-field"
|
||||
<Hds::Form::Textarea::Field
|
||||
@value="This is my description"
|
||||
name="textarea-field"
|
||||
disabled={{form.disabled}}
|
||||
as |F|>
|
||||
<F.Label>Short description</F.Label>
|
||||
@@ -133,7 +132,6 @@ module('Integration | Component | rose/form', function (hooks) {
|
||||
});
|
||||
|
||||
test('it re-enables read-only mode if the submit handler returns a resolving promise', async function (assert) {
|
||||
assert.expect(15);
|
||||
this.cancel = () => {};
|
||||
await render(hbs`
|
||||
<Rose::Form
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Component | rose/form/actions', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders a submit button and a regular button', async function (assert) {
|
||||
assert.expect(2);
|
||||
this.cancel = () => {};
|
||||
await render(
|
||||
hbs`
|
||||
@@ -28,7 +27,6 @@ module('Integration | Component | rose/form/actions', function (hooks) {
|
||||
});
|
||||
|
||||
test('it can disable the buttons', async function (assert) {
|
||||
assert.expect(2);
|
||||
this.cancel = () => {};
|
||||
await render(
|
||||
hbs`
|
||||
@@ -46,7 +44,6 @@ module('Integration | Component | rose/form/actions', function (hooks) {
|
||||
});
|
||||
|
||||
test('it optionally does not render the cancel button', async function (assert) {
|
||||
assert.expect(2);
|
||||
await render(hbs`
|
||||
<Rose::Form::Actions @submitText='Save' @showCancel={{false}} />
|
||||
`);
|
||||
|
||||
@@ -14,7 +14,6 @@ module(
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders a regular button', async function (assert) {
|
||||
assert.expect(1);
|
||||
this.enableEdit = () => {};
|
||||
await render(
|
||||
hbs`
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Component | rose/form/checkbox', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(3);
|
||||
await render(hbs`<Rose::Form::Checkbox @label="Label" />`);
|
||||
assert.strictEqual(find('label').textContent.trim(), 'Label');
|
||||
assert.ok(find('input'));
|
||||
@@ -20,7 +19,6 @@ module('Integration | Component | rose/form/checkbox', function (hooks) {
|
||||
});
|
||||
|
||||
test('it renders optional description paragraph', async function (assert) {
|
||||
assert.expect(3);
|
||||
await render(
|
||||
hbs`<Rose::Form::Checkbox @label="Label" @description="Hello world" />`,
|
||||
);
|
||||
@@ -36,7 +34,6 @@ module('Integration | Component | rose/form/checkbox', function (hooks) {
|
||||
});
|
||||
|
||||
test('it renders optional helper text', async function (assert) {
|
||||
assert.expect(1);
|
||||
await render(
|
||||
hbs`<Rose::Form::Checkbox @label="Label" @helperText="Hello world" />`,
|
||||
);
|
||||
|
||||
@@ -25,7 +25,6 @@ module('Integration | Component | rose/form/checkbox/group', function (hooks) {
|
||||
});
|
||||
|
||||
test('it renders checkboxes equal in length to an array of items', async function (assert) {
|
||||
assert.expect(1);
|
||||
this.items = items;
|
||||
await render(hbs`
|
||||
<Rose::Form::Checkbox::Group
|
||||
@@ -41,7 +40,6 @@ module('Integration | Component | rose/form/checkbox/group', function (hooks) {
|
||||
});
|
||||
|
||||
test('it checks checkboxes for items present in a selectedItems array', async function (assert) {
|
||||
assert.expect(1);
|
||||
this.items = items;
|
||||
this.selectedItems = selectedItems;
|
||||
await render(hbs`
|
||||
@@ -59,7 +57,6 @@ module('Integration | Component | rose/form/checkbox/group', function (hooks) {
|
||||
});
|
||||
|
||||
test('it checks checkboxes for objects present in a selectedItems array that are deeply equal', async function (assert) {
|
||||
assert.expect(1);
|
||||
this.items = items;
|
||||
this.selectedItems = [{ id: 1, name: 'Foo' }];
|
||||
this.isEqual = (item1, item2) =>
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Component | rose/form/errors', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(3);
|
||||
await render(hbs`
|
||||
<Rose::Form::Errors as |errors|>
|
||||
<errors.message>An error occurred.</errors.message>
|
||||
|
||||
@@ -37,7 +37,6 @@ module('Integration | Component | rose/form/fieldset', function (hooks) {
|
||||
}
|
||||
|
||||
test('it renders the full component', async function (assert) {
|
||||
assert.expect(4);
|
||||
await renderComponent(false);
|
||||
assert.ok(find('.rose-form-fieldset'));
|
||||
assert.strictEqual(
|
||||
@@ -55,7 +54,6 @@ module('Integration | Component | rose/form/fieldset', function (hooks) {
|
||||
});
|
||||
|
||||
test('it renders with no description', async function (assert) {
|
||||
assert.expect(4);
|
||||
await renderComponent(true);
|
||||
assert.ok(find('.rose-form-fieldset'));
|
||||
assert.strictEqual(
|
||||
@@ -70,7 +68,6 @@ module('Integration | Component | rose/form/fieldset', function (hooks) {
|
||||
});
|
||||
|
||||
test('it supports aria description for fieldset with description provided', async function (assert) {
|
||||
assert.expect(1);
|
||||
await renderComponent(false);
|
||||
const descriptionElement = find('.rose-form-fieldset-description');
|
||||
const fieldsetElement = find('.rose-form-fieldset');
|
||||
@@ -83,7 +80,6 @@ module('Integration | Component | rose/form/fieldset', function (hooks) {
|
||||
});
|
||||
|
||||
test('it does not support aria description for fieldset with no description provided', async function (assert) {
|
||||
assert.expect(3);
|
||||
await renderComponent(true);
|
||||
const fieldsetElement = find('.rose-form-fieldset');
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Component | rose/form/helper-text', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(2);
|
||||
await render(hbs`
|
||||
<Rose::Form::HelperText>
|
||||
Helper text
|
||||
|
||||
@@ -82,7 +82,6 @@ module('Integration | Component | rose/form/input', function (hooks) {
|
||||
});
|
||||
|
||||
test('it supports a fully contextual usage', async function (assert) {
|
||||
assert.expect(5);
|
||||
await render(hbs`
|
||||
<Rose::Form::Input @value="Text" @error={{true}} @contextual={{true}} as |field|>
|
||||
<field.label>Label</field.label>
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Component | rose/form/label', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(2);
|
||||
await render(hbs`
|
||||
<Rose::Form::Label>
|
||||
Form Label
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Component | rose/header/brand', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(3);
|
||||
await render(hbs`
|
||||
<Rose::Header::Brand @logo="logo" @text="Product Name" />
|
||||
`);
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Component | rose/layout/sidebar', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(4);
|
||||
await render(hbs`
|
||||
<Rose::Layout::Sidebar as |layout|>
|
||||
<layout.sidebar />
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Component | rose/list/key-value', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(2);
|
||||
await render(hbs`
|
||||
<Rose::List::KeyValue as |list|>
|
||||
<list.item as |item|>
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Component | rose/message', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(5);
|
||||
await render(hbs`
|
||||
<Rose::Message @title="Title" @subtitle="Subtitle" as |message|>
|
||||
<message.description>Description</message.description>
|
||||
|
||||
@@ -12,7 +12,6 @@ module('Integration | Component | rose/separator', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(1);
|
||||
await render(hbs`<Rose::Separator />`);
|
||||
assert.ok(find('.rose-separator'));
|
||||
});
|
||||
|
||||
@@ -12,13 +12,11 @@ module('Integration | Component | rose/toolbar', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(1);
|
||||
await render(hbs`<Rose::Toolbar />`);
|
||||
assert.ok(find('.rose-toolbar'));
|
||||
});
|
||||
|
||||
test('it renders with attributes', async function (assert) {
|
||||
assert.expect(1);
|
||||
await render(hbs`<Rose::Toolbar id="toolbar"/>`);
|
||||
assert.ok(find('#toolbar'));
|
||||
});
|
||||
|
||||
@@ -60,6 +60,9 @@ module.exports = {
|
||||
// Test files:
|
||||
files: ['tests/**/*-test.{js,ts}'],
|
||||
extends: ['plugin:qunit/recommended'],
|
||||
rules: {
|
||||
'qunit/require-expect': [2, 'except-simple'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -91,7 +91,7 @@
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-ember": "^11.11.1",
|
||||
"eslint-plugin-n": "^16.3.1",
|
||||
"eslint-plugin-qunit": "^7.3.4",
|
||||
"eslint-plugin-qunit": "^8.0.1",
|
||||
"js-bexpr": "hashicorp/js-bexpr#9b4a4b54d85eba67fdfc0990133d1518d890b1e1",
|
||||
"loader.js": "^4.7.0",
|
||||
"lodash": "4.17.21",
|
||||
|
||||
Loaded 100 of 227 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user