Skip to content

Commit 9c028ed

Browse files
FE: Filters: Display CEL help when editing filter (#646)
Co-authored-by: Roman Zabaluev <[email protected]>
1 parent c138f80 commit 9c028ed

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

frontend/src/components/Topics/Topic/Messages/Filters/AddEditFilterContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ const AddEditFilterContainer: React.FC<AddEditFilterContainerProps> = ({
196196
</FormError>
197197
</div>
198198
<S.FilterButtonWrapper isEdit={isEdit}>
199-
{!isEdit && <QuestionInfo />}
199+
<QuestionInfo />
200200
<Flexbox gap="10px">
201201
<Button
202202
buttonSize="M"

frontend/src/components/Topics/Topic/Messages/Filters/Filters.styled.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export const SavedFilterName = styled.div`
142142

143143
export const FilterButtonWrapper = styled.div<{ isEdit: boolean }>`
144144
display: flex;
145-
justify-content: ${(props) => (props.isEdit ? 'flex-end' : 'space-between')};
145+
justify-content: space-between;
146146
margin-top: 10px;
147147
gap: 10px;
148148
padding-top: 16px;

frontend/src/components/Topics/Topic/Messages/Filters/__tests__/AddEditFilterContainer.spec.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ describe('AddEditFilterContainer component', () => {
7373
expect(submitButtonElem).toBeEnabled();
7474
});
7575

76+
it('should display the CEL syntax help icon', async () => {
77+
const celHelpIcon = screen.queryByLabelText('info');
78+
expect(celHelpIcon).toBeVisible();
79+
expect(celHelpIcon).toBeEnabled();
80+
});
81+
7682
// TODO needs a rethink
7783
// it('should view the error message after typing and clearing the input', async () => {
7884
// const inputs = screen.getAllByRole('textbox');
@@ -115,6 +121,12 @@ describe('AddEditFilterContainer component', () => {
115121
const checkbox = screen.queryByRole('checkbox');
116122
expect(checkbox).not.toBeInTheDocument();
117123
});
124+
125+
it('should display the CEL syntax help icon', async () => {
126+
const celHelpIcon = screen.queryByLabelText('info');
127+
expect(celHelpIcon).toBeVisible();
128+
expect(celHelpIcon).toBeEnabled();
129+
});
118130
});
119131

120132
describe('Cancel and Submit button functionality', () => {

0 commit comments

Comments
 (0)