Skip to content

Commit

Permalink
updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenClontz committed Nov 2, 2024
1 parent 949aec3 commit 20876da
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/viewer/src/stores/list.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type Item = { name: string; value: number }
const items: Item[] = [
{ name: 'Two', value: 2 },
{ name: 'Twelve', value: 12 },
{ name: 'Twenty', value: 20 },
{ name: 'One', value: 1 },
{ name: 'Three', value: 3 },
{ name: 'Eight', value: 8 },
Expand Down Expand Up @@ -35,14 +36,14 @@ it('has the expected values', () => {

it('can sort', () => {
store.sort('name')()
expect(values()).toEqual([8, 1, 3, 12, 2])
expect(values()).toEqual([8, 1, 3, 12, 20, 2])

store.sort('value')()
expect(values()).toEqual([1, 2, 3, 8, 12])
expect(values()).toEqual([1, 2, 3, 8, 12, 20])
})

it('can filter', () => {
store.filter.set('twe')
store.filter.set('twel')

expect(values()).toEqual([12, 2])
expect(values()).toEqual([12, 20])
})

0 comments on commit 20876da

Please sign in to comment.