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:
Alex Grozav
2023-04-21 18:51:08 +03:00
committed by GitHub
parent 8a38624cbc
commit 9c94050deb
90 changed files with 265 additions and 235 deletions

View File

@@ -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();