Skip to content

Commit 6dfeedf

Browse files
committed
Fix js tests
1 parent 2cff61f commit 6dfeedf

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

public/js/tests/search_query.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('SEARCH COMPONENT', () => {
1818
});
1919

2020
test('should render the search component textarea', () => {
21-
expect(inputEl).toHaveClass('form-control');
21+
expect(inputEl).toBeInTheDocument();
2222
});
2323

2424
test('clear button should only become visible if textarea is not empty', () => {
@@ -33,7 +33,7 @@ describe('SEARCH COMPONENT', () => {
3333
test('should correctly detect the amino-acid sequence type and show notification', () => {
3434
// populate search
3535
fireEvent.change(inputEl, { target: { value: AMINO_ACID_SEQUENCE } });
36-
const activeNotification = container.querySelector('.notification.active');
36+
const activeNotification = container.querySelector('[data-role=notification].active');
3737
expect(activeNotification.id).toBe('protein-sequence-notification');
3838
const alertWrapper = activeNotification.children[0];
3939
expect(alertWrapper).toHaveTextContent('Detected: amino-acid sequence(s).');
@@ -42,23 +42,23 @@ describe('SEARCH COMPONENT', () => {
4242
test('should correctly detect the nucleotide sequence type and show notification', () => {
4343
// populate search
4444
fireEvent.change(inputEl, { target: { value: NUCLEOTIDE_SEQUENCE } });
45-
const activeNotification = container.querySelector('.notification.active');
45+
const activeNotification = container.querySelector('[data-role=notification].active');
4646
const alertWrapper = activeNotification.children[0];
4747
expect(activeNotification.id).toBe('nucleotide-sequence-notification');
4848
expect(alertWrapper).toHaveTextContent('Detected: nucleotide sequence(s).');
4949
});
5050

5151
test('should correctly detect the mixed sequences and show error notification', () => {
5252
fireEvent.change(inputEl, { target: { value: `${NUCLEOTIDE_SEQUENCE}${AMINO_ACID_SEQUENCE}` } });
53-
const activeNotification = container.querySelector('.notification.active');
53+
const activeNotification = container.querySelector('[data-role=notification].active');
5454
expect(activeNotification.id).toBe('mixed-sequence-notification');
5555
const alertWrapper = activeNotification.children[0];
5656
expect(alertWrapper).toHaveTextContent('Error: mixed nucleotide and amino-acid sequences detected.');
5757
});
5858

5959
test('should correctly detect FASTQ and convert it to FASTA', () => {
6060
fireEvent.change(inputEl, { target: { value: FASTQ_SEQUENCE } });
61-
const activeNotification = container.querySelector('.notification.active');
61+
const activeNotification = container.querySelector('[data-role=notification].active');
6262
const alertWrapper = activeNotification.children[0];
6363
expect(activeNotification.id).toBe('fastq-sequence-notification');
6464
expect(alertWrapper).toHaveTextContent('Detected FASTQ and automatically converted to FASTA.');

0 commit comments

Comments
 (0)