Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
theosanderson committed May 21, 2024
1 parent d326f7a commit 8562aa5
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions website/src/components/SequenceDetailsPage/getTableData.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,35 +76,8 @@ describe('getTableData', () => {
test('should return default values when there is no data', async () => {
const result = await getTableData(accessionVersion, schema, lapisClient);

const defaultList: TableDataEntry[] = [
{
label: 'Metadata field1',
name: 'metadataField1',
value: 'N/A',
customDisplay: undefined,
header: 'testHeader1',
type: { kind: 'metadata', metadataType: 'string' },
},
{
label: 'Metadata field2',
name: 'metadataField2',
value: 'N/A',
customDisplay: undefined,
header: '',
type: { kind: 'metadata', metadataType: 'string' },
},
{
label: 'Timestamp field',
name: 'timestampField',
value: 'N/A',
customDisplay: undefined,
header: '',
type: { kind: 'metadata', metadataType: 'timestamp' },
},
];

const data = result._unsafeUnwrap().data;
expect(data).toStrictEqual(defaultList.concat(defaultMutationsInsertionsDeletionsList));
expect(data).toStrictEqual(defaultMutationsInsertionsDeletionsList);

Check failure on line 80 in website/src/components/SequenceDetailsPage/getTableData.spec.ts

View workflow job for this annotation

GitHub Actions / Unit Tests

src/components/SequenceDetailsPage/getTableData.spec.ts > getTableData > should return default values when there is no data

AssertionError: expected [ …(9) ] to strictly equal [ …(6) ] - Expected + Received Array [ Object { + "customDisplay": undefined, + "header": "testHeader1", + "label": "Metadata field1", + "name": "metadataField1", + "type": Object { + "kind": "metadata", + "metadataType": "string", + }, + "value": "N/A", + }, + Object { + "customDisplay": undefined, + "header": "", + "label": "Metadata field2", + "name": "metadataField2", + "type": Object { + "kind": "metadata", + "metadataType": "string", + }, + "value": "N/A", + }, + Object { + "customDisplay": undefined, + "header": "", + "label": "Timestamp field", + "name": "timestampField", + "type": Object { + "kind": "metadata", + "metadataType": "timestamp", + }, + "value": "N/A", + }, + Object { "customDisplay": Object { "type": "badge", "value": Array [], }, "header": "Nucleotide mutations", "label": "Substitutions", "name": "nucleotideSubstitutions", "type": Object { "kind": "mutation", }, "value": "", }, Object { "header": "Nucleotide mutations", "label": "Deletions", "name": "nucleotideDeletions", "type": Object { "kind": "mutation", }, "value": "", }, Object { "header": "Nucleotide mutations", "label": "Insertions", "name": "nucleotideInsertions", "type": Object { "kind": "mutation", }, "value": "", }, Object { "customDisplay": Object { "type": "badge", "value": Array [], }, "header": "Amino acid mutations", "label": "Substitutions", "name": "aminoAcidSubstitutions", "type": Object { "kind": "mutation", }, "value": "", }, Object { "header": "Amino acid mutations", "label": "Deletions", "name": "aminoAcidDeletions", "type": Object { "kind": "mutation", }, "value": "", }, Object { "header": "Amino acid mutations", "label": "Insertions", "name": "aminoAcidInsertions", "type": Object { "kind": "mutation", }, "value": "", }, ] ❯ src/components/SequenceDetailsPage/getTableData.spec.ts:80:22
});

test('should return details field values', async () => {
Expand Down

0 comments on commit 8562aa5

Please sign in to comment.