Skip to content

Commit

Permalink
setting adminCheck to false by default (#4233)
Browse files Browse the repository at this point in the history
Co-authored-by: cthulhuplus <brookswm@gmail.com>
  • Loading branch information
thetif and cthulhuplus authored Jul 27, 2022
1 parent b6ea9e9 commit 78e8667
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 40 deletions.
48 changes: 16 additions & 32 deletions e2e/cypress/helpers/apd/key-state-personnel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ export const testDefaultKeyStatePersonnel = () => {
cy.url().should('contain', '/state-profile');
cy.findByRole('heading', { name: /Key State Personnel/i }).should('exist');

cy.contains('Provide the name of the State Medicaid Director.');
cy.contains('Provide the email address of the State Medicaid Director.');
cy.contains('Provide a valid phone number for the State Medicaid Director.');
cy.contains('Provide a mailing street address for the Medicaid office.');
cy.contains('Provide a city name.');
cy.contains('Provide a zip code.');
// cy.contains('Provide the name of the State Medicaid Director.');
// cy.contains('Provide the email address of the State Medicaid Director.');
// cy.contains('Provide a valid phone number for the State Medicaid Director.');
// cy.contains('Provide a mailing street address for the Medicaid office.');
// cy.contains('Provide a city name.');
// cy.contains('Provide a zip code.');

cy.get('input[name="medicaidDirector.name"]')
.clear()
.should('have.text', '');

cy.get('input[name="medicaidDirector.email"]')
.clear()
.should('have.text', '')
.should('have.text', '');

cy.get('input[name="medicaidDirector.phone"]')
.clear()
Expand All @@ -32,13 +32,9 @@ export const testDefaultKeyStatePersonnel = () => {
.clear()
.should('have.text', '');

cy.get('input[name="medicaidOffice.city"]')
.clear()
.should('have.text', '');
cy.get('input[name="medicaidOffice.city"]').clear().should('have.text', '');

cy.get('input[name="medicaidOffice.zip"]')
.clear()
.should('have.text', '');
cy.get('input[name="medicaidOffice.zip"]').clear().should('have.text', '');

cy.get('select[name="medicaidOffice.state"]')
.invoke('val', '')
Expand Down Expand Up @@ -116,13 +112,9 @@ export const testKeyStatePersonnelWithData = years => {

cy.findByRole('button', { name: /Add Primary Contact/i }).click();

cy.get('[data-cy="key-person-0__name"]')
.clear()
.type(userData[1].name);
cy.get('[data-cy="key-person-0__name"]').clear().type(userData[1].name);

cy.get('[data-cy="key-person-0__email"]')
.clear()
.type(userData[1].email);
cy.get('[data-cy="key-person-0__email"]').clear().type(userData[1].email);

cy.get('[data-cy="key-person-0__position"]')
.clear()
Expand All @@ -144,7 +136,7 @@ export const testKeyStatePersonnelWithData = years => {
});
cy.get('.form-and-review-list')
.findAllByRole('button', { name: /Edit/i })
.click()
.click();

// Toggle to see if the FFY cost prompts appear/disappear
cy.get('input[type="radio"][value="yes"]').check({ force: true });
Expand All @@ -164,13 +156,9 @@ export const testKeyStatePersonnelWithData = years => {
cy.findByRole('button', { name: /Add Key Personnel/i }).click();

cy.fixture('users').then(userData => {
cy.get('[data-cy="key-person-1__name"]')
.clear()
.type(userData[2].name);
cy.get('[data-cy="key-person-1__name"]').clear().type(userData[2].name);

cy.get('[data-cy="key-person-1__email"]')
.clear()
.type(userData[2].email);
cy.get('[data-cy="key-person-1__email"]').clear().type(userData[2].email);

cy.get('[data-cy="key-person-1__position"]')
.clear()
Expand Down Expand Up @@ -198,13 +186,9 @@ export const testKeyStatePersonnelWithData = years => {
cy.findByRole('button', { name: /Add Key Personnel/i }).click();

cy.fixture('users').then(userData => {
cy.get('[data-cy="key-person-2__name"]')
.clear()
.type(userData[3].name);
cy.get('[data-cy="key-person-2__name"]').clear().type(userData[3].name);

cy.get('[data-cy="key-person-2__email"]')
.clear()
.type(userData[3].email);
cy.get('[data-cy="key-person-2__email"]').clear().type(userData[3].email);

cy.get('[data-cy="key-person-2__position"]')
.clear()
Expand Down
4 changes: 2 additions & 2 deletions web/src/pages/apd/ApdReadOnly.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ describe('<ApdViewOnly/>', () => {
},
initialHistory: ['/apd/1']
});
expect(screen.getByText('HITECH IAPD')).toBeTruthy();
expect(screen.getByText('2020-2021 APD')).toBeTruthy();
expect(await screen.findByText('HITECH IAPD')).toBeTruthy();
expect(await screen.findByText('2020-2021 APD')).toBeTruthy();

await user.click(screen.getByRole('button', { name: '< Back to APD' }));
expect(history.length).toEqual(1);
Expand Down
2 changes: 1 addition & 1 deletion web/src/redux/reducers/apd.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ const initialState = {
loaded: false,
error: '',
selectAPDOnLoad: false,
adminCheck: process.env.TEALIUM_ENV !== 'prod'
adminCheck: false
};

// eslint-disable-next-line default-param-last
Expand Down
10 changes: 5 additions & 5 deletions web/src/redux/reducers/apd.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('APD reducer', () => {
loaded: false,
error: '',
selectAPDOnLoad: false,
adminCheck: true
adminCheck: false
};

it('should handle initial state', () => {
Expand Down Expand Up @@ -78,7 +78,7 @@ describe('APD reducer', () => {
loaded: false,
error: '',
selectAPDOnLoad: false,
adminCheck: true
adminCheck: false
});
});

Expand All @@ -90,7 +90,7 @@ describe('APD reducer', () => {
loaded: false,
error: '',
selectAPDOnLoad: false,
adminCheck: true
adminCheck: false
});
});

Expand Down Expand Up @@ -135,7 +135,7 @@ describe('APD reducer', () => {
fetching: false,
loaded: true,
selectAPDOnLoad: false,
adminCheck: true
adminCheck: false
};

expect(
Expand All @@ -156,7 +156,7 @@ describe('APD reducer', () => {
loaded: false,
error: 'some error',
selectAPDOnLoad: false,
adminCheck: true
adminCheck: false
});
});

Expand Down

0 comments on commit 78e8667

Please sign in to comment.