Skip to content

Commit

Permalink
fix: udpate import paths
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Oct 16, 2024
1 parent 8ea4349 commit e653928
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 48 deletions.
10 changes: 4 additions & 6 deletions cypress/e2e/homePage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { HttpMethod, formatDate } from '@graasp/sdk';

import { StatusCodes } from 'http-status-codes';

import i18n from '@/config/i18n';
import i18n from '../../src/config/i18n';
import {
AVATAR_UPLOAD_ICON_ID,
AVATAR_UPLOAD_INPUT_ID,
Expand All @@ -14,8 +14,7 @@ import {
MEMBER_AVATAR_IMAGE_ID,
MEMBER_CREATED_AT_ID,
MEMBER_USERNAME_DISPLAY_ID,
} from '@/config/selectors';

} from '../../src/config/selectors';
import { BOB, MEMBER_WITH_AVATAR } from '../fixtures/members';
import {
AVATAR_LINK,
Expand Down Expand Up @@ -76,10 +75,9 @@ class TestHelper {
}

describe('Upload Avatar', () => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
let helpers: TestHelper;
beforeEach(() => {
helpers = new TestHelper({ currentMember: BOB });
// eslint-disable-next-line no-new
new TestHelper({ currentMember: BOB });
cy.visit('/');
});

Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/notFoundPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import {
GO_TO_HOME_LINK_ID,
NOT_FOUND_MESSAGE_ID,
NOT_FOUND_TEXT_ID,
} from '@/config/selectors';

} from '../../src/config/selectors';
import { BOB } from '../fixtures/members';

describe('404 Page Test', () => {
Expand Down
7 changes: 3 additions & 4 deletions cypress/e2e/profile/password.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FAILURE_MESSAGES, namespaces } from '@graasp/translations';

import i18n, { ACCOUNT_NAMESPACE } from '@/config/i18n';
import { PROFILE_PATH } from '@/config/paths';
import i18n, { ACCOUNT_NAMESPACE } from '../../../src/config/i18n';
import { PROFILE_PATH } from '../../../src/config/paths';
import {
PASSWORD_CREATE_CONTAINER_ID,
PASSWORD_DISPLAY_CONTAINER_ID,
Expand All @@ -11,8 +11,7 @@ import {
PASSWORD_INPUT_CURRENT_PASSWORD_ID,
PASSWORD_INPUT_NEW_PASSWORD_ID,
PASSWORD_SAVE_BUTTON_ID,
} from '@/config/selectors';

} from '../../../src/config/selectors';
import { ACCOUNT } from '../../../src/langs/constants';
import { BOB } from '../../fixtures/members';

Expand Down
6 changes: 2 additions & 4 deletions cypress/e2e/profile/personalInformation.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { PROFILE_PATH } from 'config/paths';

import { PROFILE_PATH } from '../../../src/config/paths';
import {
PERSONAL_INFO_CANCEL_BUTTON_ID,
PERSONAL_INFO_DISPLAY_CONTAINER_ID,
Expand All @@ -9,8 +8,7 @@ import {
PERSONAL_INFO_INPUT_EMAIL_ID,
PERSONAL_INFO_SAVE_BUTTON_ID,
PERSONAL_INFO_USERNAME_DISPLAY_ID,
} from '@/config/selectors';

} from '../../../src/config/selectors';
import { BOB, MEMBERS } from '../../fixtures/members';

const changeUsername = (newUserName: string) => {
Expand Down
5 changes: 2 additions & 3 deletions cypress/e2e/profile/publicProfile.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PROFILE_PATH } from '@/config/paths';
import { PROFILE_PATH } from '../../../src/config/paths';
import {
PUBLIC_PROFILE_BIO_ID,
PUBLIC_PROFILE_EDIT_BUTTON_ID,
Expand All @@ -9,8 +9,7 @@ import {
PUBLIC_PROFILE_SAVE_BUTTON_ID,
PUBLIC_PROFILE_TWITTER_HREF_ID,
PUBLIC_PROFILE_TWITTER_ID,
} from '@/config/selectors';

} from '../../../src/config/selectors';
import {
BOB,
MEMBER_EMPTY_PUBLIC_PROFILE,
Expand Down
5 changes: 2 additions & 3 deletions cypress/e2e/settings/preferences.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EmailFrequency } from '@graasp/sdk';
import { langs } from '@graasp/translations';

import { SETTINGS_PATH } from '@/config/paths';
import { SETTINGS_PATH } from '../../../src/config/paths';
import {
PREFERENCES_ANALYTICS_SWITCH_ID,
PREFERENCES_CANCEL_BUTTON_ID,
Expand All @@ -11,8 +11,7 @@ import {
PREFERENCES_LANGUAGE_DISPLAY_ID,
PREFERENCES_LANGUAGE_SWITCH_ID,
PREFERENCES_SAVE_BUTTON_ID,
} from '@/config/selectors';

} from '../../../src/config/selectors';
import { BOB, CURRENT_MEMBER } from '../../fixtures/members';

describe('Display preferences', () => {
Expand Down
7 changes: 3 additions & 4 deletions cypress/e2e/storage.cy.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { formatDate, formatFileSize } from '@graasp/sdk';

import i18n from '@/config/i18n';
import { STORAGE_PATH } from '@/config/paths';
import i18n from '../../src/config/i18n';
import { STORAGE_PATH } from '../../src/config/paths';
import {
MEMBER_STORAGE_FILE_NAME_ID,
MEMBER_STORAGE_FILE_SIZE_ID,
MEMBER_STORAGE_FILE_UPDATED_AT_ID,
MEMBER_STORAGE_PARENT_FOLDER_ID,
STORAGE_BAR_LABEL_ID,
getCellId,
} from '@/config/selectors';

} from '../../src/config/selectors';
import {
CURRENT_MEMBER,
MEMBER_STORAGE_ITEM_RESPONSE,
Expand Down
5 changes: 2 additions & 3 deletions cypress/e2e/validateEmailPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import { HttpMethod } from '@graasp/sdk';

import { StatusCodes } from 'http-status-codes';

import { EMAIL_CHANGE_VALIDATION_PATH } from '@/config/paths';
import { EMAIL_CHANGE_VALIDATION_PATH } from '../../src/config/paths';
import {
EMAIL_VALIDATION_BUTTON_ID,
EMAIL_VALIDATION_CONFLICT_MESSAGE_ID,
EMAIL_VALIDATION_SUCCESS_MESSAGE_ID,
EMAIL_VALIDATION_UNAUTHORIZED_MESSAGE_ID,
} from '@/config/selectors';

} from '../../src/config/selectors';
import { CURRENT_MEMBER } from '../fixtures/members';

const API_HOST = Cypress.env('VITE_GRAASP_API_HOST');
Expand Down
14 changes: 3 additions & 11 deletions tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": [
"ES2020",
"DOM",
"DOM.Iterable"
],
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
Expand All @@ -22,12 +18,8 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"paths": {
"@/*": [
"./src/*"
]
"@/*": ["./src/*"]
}
},
"include": [
"src"
]
"include": ["src"]
}
6 changes: 5 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@
{
"path": "./tsconfig.node.json"
}
]
],
"compilerOptions": {
// this is needed for cypress to compile to ESM ... Should be removed when not using cypress anymore
"module": "ESNext"
}
}
9 changes: 2 additions & 7 deletions tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"compilerOptions": {
"target": "ES2022",
"lib": [
"ES2023"
],
"lib": ["ES2023"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
Expand All @@ -18,8 +16,5 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": [
"vite-env.d.ts",
"vite.config.ts"
]
"include": ["vite-env.d.ts", "vite.config.ts"]
}

0 comments on commit e653928

Please sign in to comment.