fix(editor): Fix RunData non-binary pagination when binary data is present (#11309)

This commit is contained in:
Charlie Kolb 2024-10-22 11:00:34 +02:00 committed by GitHub
parent 45274f2e7f
commit 901888d5b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 41 additions and 1 deletions

View file

@ -1745,7 +1745,7 @@ export default defineComponent({
v-if="
hasNodeRun &&
!hasRunError &&
binaryData.length === 0 &&
displayMode !== 'binary' &&
dataCount > pageSize &&
!isSchemaView &&
!isArtificialRecoveredEventItem

View file

@ -154,6 +154,46 @@ describe('RunData', () => {
expect(pinDataButton).toBeEnabled();
});
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,