chore: 🤖 upgrade deps for ember 3.28 and fix qunit lint errors
This commit is contained in:
46 files changed
+282
-195
No files matched your search
@@ -150,12 +150,12 @@ module('Acceptance | accounts | create', function (hooks) {
|
||||
await fillIn('[name="name"]', 'new account');
|
||||
await click('form [type="submit"]');
|
||||
await a11yAudit();
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
assert.equal(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
|
||||
@@ -93,8 +93,8 @@ module('Acceptance | accounts | delete', function (hooks) {
|
||||
await visit(urls.account);
|
||||
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
|
||||
await a11yAudit();
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'Oops.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
|
||||
@@ -100,13 +100,13 @@ module('Acceptance | accounts | set password', function (hooks) {
|
||||
// NOTE: since set password is a tabbed route with easy navigation away
|
||||
// from the form, and the form does not directly operate on a model instance,
|
||||
// a "cancel" flow doesn't make much sense. Disabling for now.
|
||||
// test('can cancel setting new password', async function (assert) {
|
||||
// assert.expect(1);
|
||||
// await visit(urls.setPassword);
|
||||
// await fillIn('[name="password"]', 'update password');
|
||||
// await click('form button:not([type="submit"])');
|
||||
// assert.notOk(find('[name="password"]').textContent.trim());
|
||||
// });
|
||||
test.skip('can cancel setting new password', async function (assert) {
|
||||
assert.expect(1);
|
||||
await visit(urls.setPassword);
|
||||
await fillIn('[name="password"]', 'update password');
|
||||
await click('form button:not([type="submit"])');
|
||||
assert.notOk(find('[name="password"]').textContent.trim());
|
||||
});
|
||||
|
||||
test('errors are displayed when setting password fails', async function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
@@ -103,8 +103,8 @@ module('Acceptance | accounts | update', function (hooks) {
|
||||
await fillIn('[name="name"]', 'save account');
|
||||
await click('form [type="submit"]');
|
||||
await a11yAudit();
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'Oops.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
@@ -136,12 +136,12 @@ module('Acceptance | accounts | update', function (hooks) {
|
||||
await fillIn('[name="name"]', 'existing account');
|
||||
await click('form [type="submit"]');
|
||||
await a11yAudit();
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
assert.equal(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
|
||||
@@ -72,8 +72,8 @@ module('Acceptance | auth methods | delete', function (hooks) {
|
||||
await visit(urls.authMethod);
|
||||
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
|
||||
await a11yAudit();
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'Oops.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
|
||||
@@ -102,38 +102,38 @@ module('Acceptance | auth methods | oidc', function (hooks) {
|
||||
});
|
||||
|
||||
// FIXME: How to mock just one request routed to /auth-methods and let everything else passthrough?
|
||||
// test('errors are displayed when state update fails', async function (assert) {
|
||||
// assert.expect(2);
|
||||
// this.server.post('/auth-methods/:idMethod', (_, request) => {
|
||||
// // Only respond to state update with error
|
||||
// if (request.params.idMethod.match(/(change-state)/i)) {
|
||||
// return new Response(
|
||||
// 400,
|
||||
// {},
|
||||
// {
|
||||
// status: 400,
|
||||
// code: 'error',
|
||||
// message: 'Sorry!',
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
// return request;
|
||||
// });
|
||||
// const newState = 'inactive';
|
||||
// await visit(urls.authMethod);
|
||||
// await click('.rose-layout-page-actions .rose-dropdown-trigger');
|
||||
// await click(`.rose-dropdown[open] input[value="${newState}"]`);
|
||||
// // debugger;
|
||||
// const authMethod = this.server.db.authMethods.find(instances.authMethod.id);
|
||||
// assert.notEqual(
|
||||
// newState,
|
||||
// authMethod.attributes.state,
|
||||
// 'Auth method state is not be updated.'
|
||||
// );
|
||||
// assert.ok(
|
||||
// find('[role="alert"]').textContent.trim(),
|
||||
// 'Sorry!',
|
||||
// 'Displays error message.'
|
||||
// );
|
||||
// });
|
||||
test.skip('errors are displayed when state update fails', async function (assert) {
|
||||
assert.expect(2);
|
||||
this.server.post('/auth-methods/:idMethod', (_, request) => {
|
||||
// Only respond to state update with error
|
||||
if (request.params.idMethod.match(/(change-state)/i)) {
|
||||
return new Response(
|
||||
400,
|
||||
{},
|
||||
{
|
||||
status: 400,
|
||||
code: 'error',
|
||||
message: 'Sorry!',
|
||||
}
|
||||
);
|
||||
}
|
||||
return request;
|
||||
});
|
||||
const newState = 'inactive';
|
||||
await visit(urls.authMethod);
|
||||
await click('.rose-layout-page-actions .rose-dropdown-trigger');
|
||||
await click(`.rose-dropdown[open] input[value="${newState}"]`);
|
||||
// debugger;
|
||||
const authMethod = this.server.db.authMethods.find(instances.authMethod.id);
|
||||
assert.notEqual(
|
||||
newState,
|
||||
authMethod.attributes.state,
|
||||
'Auth method state is not be updated.'
|
||||
);
|
||||
assert.ok(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'Sorry!',
|
||||
'Displays error message.'
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -102,50 +102,12 @@ module('Acceptance | auth methods | update', function (hooks) {
|
||||
await fillIn('[name="name"]', 'existing auth method');
|
||||
await click('form [type="submit"]');
|
||||
await a11yAudit();
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
);
|
||||
});
|
||||
|
||||
test('saving an existing auth method with invalid fields displays error messages', async function (assert) {
|
||||
assert.expect(2);
|
||||
this.server.patch('/auth-methods/:id', () => {
|
||||
return new Response(
|
||||
400,
|
||||
{},
|
||||
{
|
||||
status: 400,
|
||||
code: 'invalid_argument',
|
||||
message: 'The request was invalid.',
|
||||
details: {
|
||||
request_fields: [
|
||||
{
|
||||
name: 'name',
|
||||
description: 'Name is required.',
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
);
|
||||
});
|
||||
await visit(urls.authMethod);
|
||||
await click('form [type="button"]', 'Activate edit mode');
|
||||
await fillIn('[name="name"]', 'existing auth method');
|
||||
await click('form [type="submit"]');
|
||||
await a11yAudit();
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
assert.equal(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
fillIn,
|
||||
click,
|
||||
find,
|
||||
//findAll,
|
||||
findAll,
|
||||
getRootElement,
|
||||
//setupOnerror,
|
||||
} from '@ember/test-helpers';
|
||||
@@ -300,23 +300,23 @@ module('Acceptance | authentication', function (hooks) {
|
||||
// This test is disabled because it is no longer relevant. On deauth,
|
||||
// the page is reloaded. If the user was viewing a route requiring
|
||||
// authentication, they will be redirected accordingly.
|
||||
// test('deauthentication redirects to first global authenticate method', async function (assert) {
|
||||
// assert.expect(3);
|
||||
// await visit(authMethodAuthenticateURL);
|
||||
// await fillIn('[name="identification"]', 'test');
|
||||
// await fillIn('[name="password"]', 'test');
|
||||
// await click('[type="submit"]');
|
||||
// assert.ok(currentSession().isAuthenticated);
|
||||
// // Open header utilities dropdown
|
||||
// await click('.rose-header-utilities .rose-dropdown summary');
|
||||
// // Find and click on last element in dropdown - should be deauthenticate button
|
||||
// const menu = findAll(
|
||||
// '.rose-header-utilities .rose-dropdown .rose-dropdown-content button'
|
||||
// );
|
||||
// await click(menu[menu.length - 1]);
|
||||
// assert.notOk(currentSession().isAuthenticated);
|
||||
// assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
|
||||
// });
|
||||
test.skip('deauthentication redirects to first global authenticate method', async function (assert) {
|
||||
assert.expect(3);
|
||||
await visit(authMethodAuthenticateURL);
|
||||
await fillIn('[name="identification"]', 'test');
|
||||
await fillIn('[name="password"]', 'test');
|
||||
await click('[type="submit"]');
|
||||
assert.ok(currentSession().isAuthenticated);
|
||||
// Open header utilities dropdown
|
||||
await click('.rose-header-utilities .rose-dropdown summary');
|
||||
// Find and click on last element in dropdown - should be deauthenticate button
|
||||
const menu = findAll(
|
||||
'.rose-header-utilities .rose-dropdown .rose-dropdown-content button'
|
||||
);
|
||||
await click(menu[menu.length - 1]);
|
||||
assert.notOk(currentSession().isAuthenticated);
|
||||
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
|
||||
});
|
||||
|
||||
test('401 responses result in deauthentication', async function (assert) {
|
||||
assert.expect(2);
|
||||
|
||||
@@ -109,12 +109,12 @@ module('Acceptance | groups | create', function (hooks) {
|
||||
await visit(urls.newGroup);
|
||||
await fillIn('[name="name"]', 'group name');
|
||||
await click('[type="submit"]');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
assert.equal(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
|
||||
@@ -76,8 +76,8 @@ module('Acceptance | groups | delete', function (hooks) {
|
||||
});
|
||||
await visit(urls.group);
|
||||
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'Oops.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
|
||||
@@ -95,12 +95,12 @@ module('Acceptance | groups | update', function (hooks) {
|
||||
await click('form [type="button"]', 'Activate edit mode');
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await click('[type="submit"]');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
assert.equal(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
|
||||
@@ -88,8 +88,8 @@ module('Acceptance | roles | delete', function (hooks) {
|
||||
});
|
||||
await visit(urls.role);
|
||||
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'Oops.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
|
||||
@@ -107,12 +107,12 @@ module('Acceptance | roles | update', function (hooks) {
|
||||
await click('form [type="button"]', 'Activate edit mode');
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await click('[type="submit"]');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
assert.equal(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
|
||||
@@ -97,12 +97,12 @@ module('Acceptance | users | create', function (hooks) {
|
||||
await visit(newUserURL);
|
||||
await fillIn('[name="name"]', 'User name');
|
||||
await click('[type="submit"]');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
assert.equal(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
|
||||
@@ -77,8 +77,8 @@ module('Acceptance | users | delete', function (hooks) {
|
||||
});
|
||||
await visit(userURL);
|
||||
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'Oops.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
|
||||
@@ -96,12 +96,12 @@ module('Acceptance | users | update', function (hooks) {
|
||||
await click('form [type="button"]', 'Activate edit mode');
|
||||
await fillIn('[name="name"]', 'User name');
|
||||
await click('[type="submit"]');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
assert.equal(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
|
||||
Reference in new issue
Block a user