Skip to content

Commit

Permalink
deepscan and test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kurund committed Nov 24, 2023
1 parent f25a2a1 commit b1d3d82
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 28 deletions.
28 changes: 12 additions & 16 deletions src/containers/Template/Form/HSM/HSM.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,19 @@ describe('Add mode', () => {
expect(queryByText('Message is required.')).toBeInTheDocument();
});

// length validation is not working. Basically setting of
// text field value is not working hence, commenting
// below for now

// fireEvent.change(container.querySelector('input[name="label"]') as HTMLInputElement, {
// target: {
// value:
// 'We are not allowing a really long title, and we should trigger validation for this.',
// },
// });
fireEvent.change(container.querySelector('input[name="label"]') as HTMLInputElement, {
target: {
value:
'We are not allowing a really long title, and we should trigger validation for this.',
},
});

// await user.click(button);
await user.click(button);

// // we should still have 2 errors
// await waitFor(() => {
// expect(queryByText('Title length is too long.')).toBeInTheDocument();
// expect(queryByText('Message is required.')).toBeInTheDocument();
// });
// we should still have 2 errors
await waitFor(() => {
expect(queryByText('Title length is too long.')).toBeInTheDocument();
expect(queryByText('Message is required.')).toBeInTheDocument();
});
});
});
12 changes: 0 additions & 12 deletions src/containers/Template/Form/Template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,6 @@ const Template = ({
variables: { opts: { order: 'ASC' } },
});

const [getSessionTemplates, { data: sessionTemplates, loading: sessionTemplateLoading }] =
useLazyQuery<any>(FILTER_TEMPLATES, {
variables: {
filter: { languageId: language ? parseInt(language.id, 10) : null },
opts: {
order: 'ASC',
limit: null,
offset: 0,
},
},
});

const [getSessionTemplate, { data: template, loading: templateLoading }] =
useLazyQuery<any>(GET_TEMPLATE);

Expand Down

0 comments on commit b1d3d82

Please sign in to comment.