Skip to content

Commit

Permalink
test updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
Smith committed Apr 19, 2024
1 parent dee518d commit f40ee5e
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 224 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -768,46 +768,6 @@ exports[`AcquisitionView component renders as expected 1`] = `
Jul 29, 2022
</div>
</div>
<div
class="pb-2 row"
>
<div
class="pr-0 text-left col-4"
>
<label
class="c17"
>
Acquisition completed date:
<span
class="ml-2"
>
<span
class="tooltip-icon"
data-testid="tooltip-icon-section-field-tooltip"
id="section-field-tooltip"
>
<svg
class="tooltip-icon"
fill="currentColor"
height="1em"
stroke="currentColor"
stroke-width="0"
viewBox="0 0 512 512"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"
/>
</svg>
</span>
</span>
</label>
</div>
<div
class="c18 text-left col"
/>
</div>
</div>
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,46 +326,6 @@ exports[`AcquisitionFileTabs component matches snapshot 1`] = `
Jul 29, 2022
</div>
</div>
<div
class="pb-2 row"
>
<div
class="pr-0 text-left col-4"
>
<label
class="c6"
>
Acquisition completed date:
<span
class="ml-2"
>
<span
class="tooltip-icon"
data-testid="tooltip-icon-section-field-tooltip"
id="section-field-tooltip"
>
<svg
class="tooltip-icon"
fill="currentColor"
height="1em"
stroke="currentColor"
stroke-width="0"
viewBox="0 0 512 512"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"
/>
</svg>
</span>
</span>
</label>
</div>
<div
class="c7 text-left col"
/>
</div>
</div>
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,46 +218,6 @@ exports[`AcquisitionSummaryView component matches snapshot 1`] = `
Jul 29, 2022
</div>
</div>
<div
class="pb-2 row"
>
<div
class="pr-0 text-left col-4"
>
<label
class="c4"
>
Acquisition completed date:
<span
class="ml-2"
>
<span
class="tooltip-icon"
data-testid="tooltip-icon-section-field-tooltip"
id="section-field-tooltip"
>
<svg
class="tooltip-icon"
fill="currentColor"
height="1em"
stroke="currentColor"
stroke-width="0"
viewBox="0 0 512 512"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"
/>
</svg>
</span>
</span>
</label>
</div>
<div
class="c5 text-left col"
/>
</div>
</div>
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,36 +234,4 @@ describe('UpdateAcquisitionForm component', () => {
expect(validationSchema).toBeCalled();
expect(onSubmit).toHaveBeenLastCalledWith(initialValues, expect.anything());
});

it('should disable file completion date until the user marks the file as COMPLETED', async () => {
const { getFormikRef, getFileStatusDropdown, getFileCompletionDatePicker } = setup({
initialValues,
});

await act(async () => userEvent.selectOptions(getFileStatusDropdown(), 'DRAFT'));
expect(getFileCompletionDatePicker()).toBeDisabled();

// submit form to trigger validation check
await waitFor(() => getFormikRef().current?.submitForm());

expect(validationSchema).toBeCalled();
expect(onSubmit).toBeCalled();
});

it('should require a file completion date when status is set to COMPLETED', async () => {
const { getFormikRef, getFileStatusDropdown, findByText } = setup({ initialValues });

await act(async () => userEvent.selectOptions(getFileStatusDropdown(), 'COMPLT'));

// submit form to trigger validation check
await waitFor(() => getFormikRef().current?.submitForm());

expect(validationSchema).toBeCalled();
expect(
await findByText(
/Acquisition completed date is required when file status is set to "Complete"/i,
),
).toBeVisible();
expect(onSubmit).not.toBeCalled();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -870,78 +870,6 @@ exports[`UpdateAcquisitionForm component renders as expected 1`] = `
</div>
</div>
</div>
<div
class="pb-2 row"
>
<div
class="pr-0 text-left col-4"
>
<label
class="c2"
>
Acquisition completed date:
<span
class="ml-2"
>
<span
class="tooltip-icon"
data-testid="tooltip-icon-section-field-tooltip"
id="section-field-tooltip"
>
<svg
class="tooltip-icon"
fill="currentColor"
height="1em"
stroke="currentColor"
stroke-width="0"
viewBox="0 0 512 512"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"
/>
</svg>
</span>
</span>
</label>
</div>
<div
class="c3 text-left col"
>
<div
class="c6 form-group"
>
<div
class="react-datepicker-wrapper d-block"
>
<div
class="react-datepicker__input-container react-datepicker__view-calendar-icon"
>
<svg
class="react-datepicker__calendar-icon"
viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z"
/>
</svg>
<input
autocomplete="off"
class="c7 form-control date-picker"
disabled=""
id="datepicker-completionDate"
name="completionDate"
placeholder="MMM DD, YYYY"
type="text"
value=""
/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
Expand Down

0 comments on commit f40ee5e

Please sign in to comment.