Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Angi-Kinas committed Sep 6, 2023
1 parent 319c729 commit 1e09348
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions libs/ui/search/src/lib/record-table/record-table.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,33 @@ describe('RecordTableComponent', () => {
expect(component).toBeTruthy()
})

describe('get a list of formats', () => {
describe('get a list of formats and sorts them depending on priority', () => {
it('returns a list of unique formats', () => {
expect(component.createSet(DATASET_RECORDS[0])).toEqual([
expect(component.getRecordFormats(DATASET_RECORDS[0])).toEqual([
'pdf',
'shp',
'geojson',
'pdf',
])
})
})
describe('get the first format', () => {
it('returns the first format of the list', () => {
expect(component.firstFormat(DATASET_RECORDS[0])).toEqual('pdf')
})
})
describe('get the remaining formats', () => {
it('returns the first format of the list', () => {
expect(component.secondToLastFormat(DATASET_RECORDS[0])).toEqual([
'shp',
'geojson',
])
})
})
describe('get the badge color for given format', () => {
it('returns the color for its format', () => {
expect(
component.getBadgeColor(component.firstFormat(DATASET_RECORDS[0]))
).toEqual('#db544a')
})
})
})

0 comments on commit 1e09348

Please sign in to comment.