fixed tests

Signed-off-by: Frederic Kayser <frederic@frederic-kayser.de>
This commit is contained in:
Frederic Kayser
2023-03-30 20:55:17 +02:00
parent 81bee24c5d
commit 193aef4c31
4 changed files with 13 additions and 5 deletions
@@ -154,9 +154,13 @@ describe('<EntityLifecyclePicker/>', () => {
lifecycles: new EntityLifecycleFilter(['production']),
});
fireEvent.click(screen.getByTestId('lifecycle-picker-expand'));
expect(screen.getByLabelText('production')).toBeChecked();
expect(
screen
.getByTestId('lifecycle-checkbox-production')
.querySelector('input[type="checkbox"]'),
).toBeChecked();
fireEvent.click(screen.getByLabelText('production'));
fireEvent.click(screen.getByTestId('lifecycle-checkbox-label-production'));
expect(updateFilters).toHaveBeenLastCalledWith({
lifecycles: undefined,
});
@@ -111,11 +111,12 @@ export const EntityLifecyclePicker = (props: { initialFilter?: string[] }) => {
setSelectedLifecycles(value)
}
renderOption={(option, { selected }) => (
<div>
<div data-testid={`lifecycle-checkbox-label-${option}`}>
<Checkbox
icon={icon}
checkedIcon={checkedIcon}
checked={selected}
data-testid={`lifecycle-checkbox-${option}`}
/>
{option}
</div>
@@ -123,7 +123,10 @@ describe('<EntityProcessingStatusPicker/>', () => {
);
fireEvent.click(screen.getByTestId('processing-status-picker-expand'));
fireEvent.click(screen.getByText('Is Orphan'));
fireEvent.click(
screen.getByTestId('processing-status-checkbox-label-Is Orphan'),
);
expect(updateFilters).toHaveBeenCalledWith({
orphan: undefined,
});
@@ -82,7 +82,7 @@ export const EntityProcessingStatusPicker = () => {
errorChange(value.includes('Has Error'));
}}
renderOption={(option, { selected }) => (
<div>
<div data-testid={`processing-status-checkbox-label-${option}`}>
<Checkbox
icon={icon}
checkedIcon={checkedIcon}