Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(editor): Use virtual scrolling in RunDataJson.vue #10838

Merged
merged 7 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
update tests
  • Loading branch information
RicardoE105 committed Sep 18, 2024
commit 69b50eb27d194b195c7617dc0c4e39cf0ac823da
28 changes: 16 additions & 12 deletions packages/editor-ui/src/components/__tests__/RunDataJson.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@ import { createTestingPinia } from '@pinia/testing';
import { screen, cleanup } from '@testing-library/vue';
import RunDataJson from '@/components/RunDataJson.vue';
import { createComponentRenderer } from '@/__tests__/render';
import { useElementSize } from '@vueuse/core'; // Import the composable to mock

vi.mock('@vueuse/core', async () => {
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
const originalModule = await vi.importActual<typeof import('@vueuse/core')>('@vueuse/core');

return {
...originalModule, // Keep all original exports
useElementSize: vi.fn(), // Mock useElementSize
};
});

(useElementSize as jest.Mock).mockReturnValue({
height: 500, // Mocked height value
width: 300, // Mocked width value
});

const renderComponent = createComponentRenderer(RunDataJson, {
props: {
Expand Down Expand Up @@ -34,18 +50,6 @@ const renderComponent = createComponentRenderer(RunDataJson, {
disabled: false,
},
},
global: {
mocks: {
$locale: {
baseText() {
return '';
},
},
$store: {
getters: {},
},
},
},
});

describe('RunDataJson.vue', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`RunDataJson.vue > renders json values properly 1`] = `
>
<div
class="vjs-tree-list"
style="height: 400px;"
style="height: 500px;"
>
<div
class="vjs-tree-list-holder"
Expand Down
Loading