From f7854b642c1bc650b7d2b92df070af8e151c3991 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Wed, 2 Jun 2021 22:44:40 -0400 Subject: [PATCH] chore: Add in-progress oidc test for visibility --- .../acceptance/auth-methods/oidc-test.js | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/ui/admin/tests/acceptance/auth-methods/oidc-test.js b/ui/admin/tests/acceptance/auth-methods/oidc-test.js index bc53aa846..3bc1f226b 100644 --- a/ui/admin/tests/acceptance/auth-methods/oidc-test.js +++ b/ui/admin/tests/acceptance/auth-methods/oidc-test.js @@ -101,24 +101,29 @@ module('Acceptance | auth methods | oidc', function (hooks) { assert.equal(authMethod.attributes.state, updateValue); }); + // 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'); - // // Load page before mocking update - // this.server.post('/auth-methods/:idMethod', () => { - // return new Response( - // 400, - // {}, - // { - // status: 400, - // code: 'error', - // message: 'Sorry!', - // } - // ); - // }); // await click(`.rose-dropdown[open] input[value="${newState}"]`); + // // debugger; // const authMethod = this.server.db.authMethods.find(instances.authMethod.id); // assert.notEqual( // newState,