fixed tests
Signed-off-by: Frederic Kayser <frederic@frederic-kayser.de>
This commit is contained in:
+6
-2
@@ -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,
|
||||
});
|
||||
|
||||
+2
-1
@@ -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>
|
||||
|
||||
+4
-1
@@ -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,
|
||||
});
|
||||
|
||||
+1
-1
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user