Skip to content

Commit

Permalink
Refs #35873 - More ouia-ids for ACS
Browse files Browse the repository at this point in the history
  • Loading branch information
sjha4 committed Jan 19, 2023
1 parent 243704d commit 22db652
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion webpack/global_test_setup.js
Expand Up @@ -16,7 +16,7 @@ global.console.error = (error, stack) => {
// 'The prop `ouiaId` is marked as required in `Modal`, but its value is `undefined`',
// 'created by WizardHeader', 'created by Navigation',
// 'created by ActionsColumn', 'created by InactiveText', 'created by Select',
// 'created by Context.Consumer'];
// 'created by Context.Consumer', 'created by DualListSelector'];

/* eslint-disable-next-line no-console */
if (stack) console.log(stack); // Prints out original stack trace
Expand Down
Expand Up @@ -47,6 +47,7 @@ const ACSCredentials = () => {
<Radio
label={__('Manual authentication')}
id="manual_auth"
ouiaId="manual_auth"
name="manual_auth"
aria-label="manual_auth"
isChecked={authentication === 'manual'}
Expand All @@ -71,6 +72,7 @@ const ACSCredentials = () => {
isRequired
type="text"
id="acs_username_field"
ouiaId="acs_username_field"
name="acs_username_field"
aria-label="acs_username_field"
value={username}
Expand All @@ -87,6 +89,7 @@ const ACSCredentials = () => {
isRequired
type="password"
id="acs_password_field"
ouiaId="acs_password_field"
name="acs_password_field"
aria-label="acs_password_field"
value={password}
Expand All @@ -98,6 +101,7 @@ const ACSCredentials = () => {
<Radio
label={__('Content credentials')}
id="content_credentials"
ouiaId="content_credentials"
aria-label="content_credentials"
name="content_cred_auth"
isChecked={authentication === 'content_credentials'}
Expand Down Expand Up @@ -163,6 +167,7 @@ const ACSCredentials = () => {
label={__('None')}
id="none"
name="none"
ouiaId="none"
aria-label="none"
isChecked={authentication === ''}
onChange={() => {
Expand All @@ -178,6 +183,7 @@ const ACSCredentials = () => {
<FormGroup label={__('Verify SSL')} fieldId="verify_ssl">
<Switch
id="verify-ssl-switch"
ouiaId="verify-ssl-switch"
aria-label="verify-ssl-switch"
isChecked={verifySSL}
onChange={checked => setVerifySSL(checked)}
Expand Down
Expand Up @@ -55,6 +55,7 @@ const ACSSmartProxies = () => {
>
<Switch
id="use-http-proxies-switch"
ouiaId="use-http-proxies-switch"
aria-label="use-http-proxies-switch"
isChecked={useHttpProxies}
onChange={checked => setUseHttpProxies(checked)}
Expand Down
Expand Up @@ -57,6 +57,7 @@ const AcsUrlPaths = () => {
isRequired
type="url"
id="acs_base_url_field"
ouiaId="acs_base_url_field"
name="acs_base_url_field"
aria-label="acs_base_url_field"
placeholder={baseURLplaceholder}
Expand Down
Expand Up @@ -31,6 +31,7 @@ const NameACS = () => {
isRequired
type="text"
id="acs_name_field"
ouiaId="acs_name_field"
name="acs_name_field"
aria-label="acs_name_field"
value={name}
Expand Down
Expand Up @@ -45,6 +45,7 @@ const ACSEditDetails = ({ onClose, acsId, acsDetails }) => {
isRequired
type="text"
id="acs_name_field"
ouiaId="acs_name_field"
name="acs_name_field"
aria-label="acs_name_field"
value={acsName}
Expand Down
@@ -1,5 +1,5 @@
import React from 'react';
import { renderWithRedux, patientlyWaitFor } from 'react-testing-lib-wrapper';
import { renderWithRedux, patientlyWaitFor, act } from 'react-testing-lib-wrapper';

import { nockInstance, assertNockRequest, mockAutocomplete, mockSetting } from '../../../../test-utils/nockWrapper';
import api from '../../../../services/api';
Expand Down Expand Up @@ -37,6 +37,7 @@ test('Can call API and show ACS on page load', async (done) => {
assertNockRequest(searchDelayScope);
assertNockRequest(autoSearchScope);
assertNockRequest(scope, done);
act(done);
});

test('Can handle no ACS being present', async (done) => {
Expand All @@ -62,4 +63,5 @@ test('Can handle no ACS being present', async (done) => {
expect(queryByLabelText('Select all')).not.toBeInTheDocument();
await patientlyWaitFor(() => expect(queryByText("You currently don't have any alternate content sources.")).toBeInTheDocument());
assertNockRequest(scope, done);
act(done);
});

0 comments on commit 22db652

Please sign in to comment.