|
|
@ -90,6 +90,18 @@ describe('LabelFilters', () => { |
|
|
|
expect(getAddButton()).toBeInTheDocument(); |
|
|
|
expect(getAddButton()).toBeInTheDocument(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('does split regex in the middle of a label value when the value contains the char |', () => { |
|
|
|
|
|
|
|
setup({ labelsFilters: [{ label: 'foo', op: '=~', value: 'boop|par' }] }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(screen.getByText('boop')).toBeInTheDocument(); |
|
|
|
|
|
|
|
expect(screen.getByText('par')).toBeInTheDocument(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
it('does not split regex in between parentheses inside of a label value that contains the char |', () => { |
|
|
|
|
|
|
|
setup({ labelsFilters: [{ label: 'foo', op: '=~', value: '(b|p)ar' }] }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(screen.getByText('(b|p)ar')).toBeInTheDocument(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('shows error when filter with empty strings and label filter is required', async () => { |
|
|
|
it('shows error when filter with empty strings and label filter is required', async () => { |
|
|
|
setup({ labelsFilters: [{ label: '', op: '=', value: '' }], labelFilterRequired: true }); |
|
|
|
setup({ labelsFilters: [{ label: '', op: '=', value: '' }], labelFilterRequired: true }); |
|
|
|
expect(screen.getByText(MISSING_LABEL_FILTER_ERROR_MESSAGE)).toBeInTheDocument(); |
|
|
|
expect(screen.getByText(MISSING_LABEL_FILTER_ERROR_MESSAGE)).toBeInTheDocument(); |
|
|
|