chore: 🤖 upgrade deps for ember 3.28 and fix qunit lint errors

This commit is contained in:
Randall Morey committed 2021-10-23 11:48:10 -04:00
1 parent 22c5140dce
commit 0879a0430d
46 files changed
+282 -195

No files matched your search

@@ -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.'