Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoE105 committed Sep 18, 2024
1 parent 153d154 commit 69b50eb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
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

0 comments on commit 69b50eb

Please sign in to comment.