Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieKolb committed Oct 18, 2024
1 parent af25b45 commit 6668966
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions packages/editor-ui/src/components/__tests__/RunData.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,46 @@ describe('RunData', () => {
expect(getByTestId('ndv-binary-data_0')).toBeInTheDocument();
});

it('should not render pagination on binary tab', async () => {
const { queryByTestId } = render(
Array.from({ length: 11 }).map((_, i) => ({
json: {
data: {
id: i,
name: `Test ${i}`,
},
},
binary: {
data: {
a: 'b',
},
},
})),
'binary',
);
expect(queryByTestId('ndv-data-pagination')).not.toBeInTheDocument();
});

it('should render pagination with binary data on non-binary tab', async () => {
const { getByTestId } = render(
Array.from({ length: 11 }).map((_, i) => ({
json: {
data: {
id: i,
name: `Test ${i}`,
},
},
binary: {
data: {
a: 'b',
},
},
})),
'json',
);
expect(getByTestId('ndv-data-pagination')).toBeInTheDocument();
});

const render = (outputData: unknown[], displayMode: IRunDataDisplayMode) => {
const pinia = createTestingPinia({
initialState: {
Expand Down

0 comments on commit 6668966

Please sign in to comment.