refactor(editor): Clean all instances of isDesktopDeployment (#10884)
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { createComponentRenderer } from '@/__tests__/render';
|
||||
import { getDropdownItems, mockedStore } from '@/__tests__/utils';
|
||||
import { createUser } from '@/__tests__/data/users';
|
||||
import { useSettingsStore } from '@/stores/settings.store';
|
||||
import { getDropdownItems } from '@/__tests__/utils';
|
||||
import PersonalizationModal from '@/components/PersonalizationModal.vue';
|
||||
import { useUsersStore } from '@/stores/users.store';
|
||||
import { createTestingPinia } from '@pinia/testing';
|
||||
import {
|
||||
COMPANY_TYPE_KEY,
|
||||
EMAIL_KEY,
|
||||
COMPANY_INDUSTRY_EXTENDED_KEY,
|
||||
OTHER_COMPANY_INDUSTRY_EXTENDED_KEY,
|
||||
MARKETING_AUTOMATION_GOAL_KEY,
|
||||
@@ -42,18 +38,6 @@ describe('PersonalizationModal', () => {
|
||||
expect(getByTitle('Customize n8n to you')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('shows user input when needed for desktop deployment', () => {
|
||||
const pinia = createTestingPinia();
|
||||
const usersStore = mockedStore(useUsersStore);
|
||||
usersStore.currentUser = createUser({ firstName: undefined });
|
||||
|
||||
const settingsStore = mockedStore(useSettingsStore);
|
||||
settingsStore.isDesktopDeployment = true;
|
||||
|
||||
const { getByTestId } = renderModal({ pinia });
|
||||
expect(getByTestId(EMAIL_KEY)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
describe('Company field', () => {
|
||||
it('allows completion of company related fields', async () => {
|
||||
const { getByTestId } = renderModal({ pinia: createTestingPinia() });
|
||||
|
||||
@@ -25,7 +25,6 @@ import {
|
||||
TELECOMS_INDUSTRY,
|
||||
OTHER_AUTOMATION_GOAL,
|
||||
COMPANY_TYPE_KEY,
|
||||
EMAIL_KEY,
|
||||
SAAS_COMPANY_TYPE,
|
||||
ECOMMERCE_COMPANY_TYPE,
|
||||
MSP_INDUSTRY,
|
||||
@@ -85,7 +84,6 @@ import {
|
||||
import { useToast } from '@/composables/useToast';
|
||||
import Modal from '@/components/Modal.vue';
|
||||
import type { IFormInputs, IPersonalizationLatestVersion } from '@/Interface';
|
||||
import { useSettingsStore } from '@/stores/settings.store';
|
||||
import { useRootStore } from '@/stores/root.store';
|
||||
import { useUsersStore } from '@/stores/users.store';
|
||||
import { createEventBus, createFormEventBus } from 'n8n-design-system/utils';
|
||||
@@ -102,7 +100,6 @@ const formBus = createFormEventBus();
|
||||
const { showError } = useToast();
|
||||
const i18n = useI18n();
|
||||
const rootStore = useRootStore();
|
||||
const settingsStore = useSettingsStore();
|
||||
const usersStore = useUsersStore();
|
||||
const posthogStore = usePostHog();
|
||||
const route = useRoute();
|
||||
@@ -112,15 +109,6 @@ const formValues = ref<Record<string, string>>({});
|
||||
const isSaving = ref(false);
|
||||
|
||||
const survey = computed<IFormInputs>(() => [
|
||||
{
|
||||
name: EMAIL_KEY,
|
||||
properties: {
|
||||
label: i18n.baseText('personalizationModal.yourEmailAddress'),
|
||||
type: 'text',
|
||||
placeholder: i18n.baseText('personalizationModal.email'),
|
||||
},
|
||||
shouldDisplay: () => settingsStore.isDesktopDeployment && !usersStore.currentUser?.firstName,
|
||||
},
|
||||
{
|
||||
name: COMPANY_TYPE_KEY,
|
||||
properties: {
|
||||
|
||||
Reference in New Issue
Block a user