Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinVandy committed Jun 30, 2024
1 parent e226e8a commit 1d0443e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/table-core/tests/RowPinning.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
getCoreRowModel,
getPaginationRowModel,
} from '../src'
import * as RowPinning from '../src/features/RowPinning'
import { makeData, Person } from './makeTestData'

type personKeys = keyof Person
Expand All @@ -23,7 +22,7 @@ function generateColumns(people: Person[]): PersonColumn[] {

describe('RowPinning', () => {
describe('createTable', () => {
describe('_getPinnedRows', () => {
describe('getTopRows', () => {
it('should return pinned rows when keepPinnedRows is true rows are visible', () => {
const data = makeData(10)
const columns = generateColumns(data)
Expand All @@ -48,7 +47,7 @@ describe('RowPinning', () => {
getCoreRowModel: getCoreRowModel(),
})

const result = table._getPinnedRows('top')
const result = table.getTopRows()

expect(result.length).toBe(2)
expect(result[0].id).toBe('0')
Expand Down Expand Up @@ -78,7 +77,7 @@ describe('RowPinning', () => {
getCoreRowModel: getCoreRowModel(),
})

const result = table._getPinnedRows('top')
const result = table.getTopRows()

expect(result.length).toBe(2)
expect(result[0].id).toBe('0')
Expand Down Expand Up @@ -108,7 +107,7 @@ describe('RowPinning', () => {
getCoreRowModel: getCoreRowModel(),
})

const result = table._getPinnedRows('top')
const result = table.getTopRows()

expect(result.length).toBe(2)
expect(result[0].id).toBe('0')
Expand Down Expand Up @@ -138,12 +137,11 @@ describe('RowPinning', () => {
getCoreRowModel: getCoreRowModel(),
})

const result = table._getPinnedRows('top')
const result = table.getTopRows()

expect(result.length).toBe(0)
})
})
describe('getTopRows', () => {

it('should return correct top rows', () => {
const data = makeData(10)
const columns = generateColumns(data)
Expand Down

0 comments on commit 1d0443e

Please sign in to comment.