refactor(editor): Migrate settings.store to composition API (no-changelog) (#10022)
Co-authored-by: Elias Meire <elias@meire.dev>
This commit is contained in:
@@ -2,9 +2,14 @@ import { createComponentRenderer } from '@/__tests__/render';
|
||||
import { createTestingPinia } from '@pinia/testing';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import Assignment from '../Assignment.vue';
|
||||
import { defaultSettings } from '@/__tests__/defaults';
|
||||
import { STORES } from '@/constants';
|
||||
import { merge } from 'lodash-es';
|
||||
|
||||
const DEFAULT_SETUP = {
|
||||
pinia: createTestingPinia(),
|
||||
pinia: createTestingPinia({
|
||||
initialState: { [STORES.SETTINGS]: { settings: merge({}, defaultSettings) } },
|
||||
}),
|
||||
props: {
|
||||
path: 'parameters.fields.0',
|
||||
modelValue: {
|
||||
|
||||
@@ -5,10 +5,16 @@ import userEvent from '@testing-library/user-event';
|
||||
import { fireEvent, within } from '@testing-library/vue';
|
||||
import * as workflowHelpers from '@/composables/useWorkflowHelpers';
|
||||
import AssignmentCollection from '../AssignmentCollection.vue';
|
||||
import { createPinia, setActivePinia } from 'pinia';
|
||||
import { STORES } from '@/constants';
|
||||
import { SETTINGS_STORE_DEFAULT_STATE } from '@/__tests__/utils';
|
||||
|
||||
const DEFAULT_SETUP = {
|
||||
pinia: createTestingPinia(),
|
||||
pinia: createTestingPinia({
|
||||
initialState: {
|
||||
[STORES.SETTINGS]: SETTINGS_STORE_DEFAULT_STATE,
|
||||
},
|
||||
stubActions: false,
|
||||
}),
|
||||
props: {
|
||||
path: 'parameters.fields',
|
||||
node: {
|
||||
@@ -97,10 +103,7 @@ describe('AssignmentCollection.vue', () => {
|
||||
});
|
||||
|
||||
it('can add assignments by drag and drop (and infer type)', async () => {
|
||||
const pinia = createPinia();
|
||||
setActivePinia(pinia);
|
||||
|
||||
const { getByTestId, findAllByTestId } = renderComponent({ pinia });
|
||||
const { getByTestId, findAllByTestId } = renderComponent();
|
||||
const dropArea = getByTestId('drop-area');
|
||||
|
||||
await dropAssignment({ key: 'boolKey', value: true, dropArea });
|
||||
|
||||
Reference in New Issue
Block a user