feat: Replace Vue.extend with defineComponent in editor-ui (no-changelog) (#6033)
* refactor: replace Vue.extend with defineComponent in editor-ui * fix: change $externalHooks extractions from mixins * fix: refactor externalHooks mixin
This commit is contained in:
@@ -4,16 +4,19 @@ import { setupServer } from '@/__tests__/server';
|
||||
import { render } from '@testing-library/vue';
|
||||
import VariablesView from '@/views/VariablesView.vue';
|
||||
import { useSettingsStore, useUsersStore } from '@/stores';
|
||||
import { renderComponent } from '@/__tests__/utils';
|
||||
|
||||
describe('store', () => {
|
||||
let server: ReturnType<typeof setupServer>;
|
||||
let pinia: ReturnType<typeof createPinia>;
|
||||
|
||||
beforeAll(() => {
|
||||
server = setupServer();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
setActivePinia(createPinia());
|
||||
pinia = createPinia();
|
||||
setActivePinia(pinia);
|
||||
|
||||
await useSettingsStore().getSettings();
|
||||
await useUsersStore().fetchUsers();
|
||||
@@ -25,13 +28,13 @@ describe('store', () => {
|
||||
});
|
||||
|
||||
it('should render loading state', () => {
|
||||
const wrapper = render(VariablesView);
|
||||
const wrapper = renderComponent(VariablesView, { pinia });
|
||||
|
||||
expect(wrapper.container.querySelectorAll('.n8n-loading')).toHaveLength(3);
|
||||
});
|
||||
|
||||
it('should render empty state', async () => {
|
||||
const wrapper = render(VariablesView);
|
||||
const wrapper = renderComponent(VariablesView, { pinia });
|
||||
|
||||
await wrapper.findByTestId('empty-resources-list');
|
||||
expect(wrapper.getByTestId('empty-resources-list')).toBeVisible();
|
||||
@@ -40,7 +43,7 @@ describe('store', () => {
|
||||
it('should render variable entries', async () => {
|
||||
server.createList('variable', 3);
|
||||
|
||||
const wrapper = render(VariablesView);
|
||||
const wrapper = renderComponent(VariablesView, { pinia });
|
||||
|
||||
await wrapper.findByTestId('resources-table');
|
||||
expect(wrapper.getByTestId('resources-table')).toBeVisible();
|
||||
|
||||
Reference in New Issue
Block a user