0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

refactor(test): rename directories

This commit is contained in:
Gao Sun 2023-09-10 14:38:20 +08:00
parent a89ce6eeed
commit 9bbe3f2f5f
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
19 changed files with 24 additions and 13 deletions

View file

@ -14,7 +14,7 @@
"test:only": "NODE_OPTIONS=--experimental-vm-modules jest",
"test": "pnpm build && pnpm test:api && pnpm test:ui",
"test:api": "pnpm test:only -i ./lib/tests/api/",
"test:ui": "pnpm test:only -i --config=jest.config.ui.js ./lib/tests/ui/",
"test:ui": "pnpm test:only -i --config=jest.config.ui.js ./lib/tests/console/ ./lib/tests/main-flow/",
"lint": "eslint --ext .ts src",
"lint:report": "pnpm lint --format json --output-file report.json",
"start": "pnpm test"

View file

@ -1,7 +1,7 @@
import { ConnectorType } from '@logto/connector-kit';
import { type Page } from 'puppeteer';
import { expectConfirmModalAndAct, waitForToast } from '#src/ui-helpers/index.js';
import { expectConfirmModalAndAct, waitForToast } from '#src/page-helpers/index.js';
import {
passwordlessConnectorTestCases,

View file

@ -7,7 +7,7 @@ import {
goToAdminConsole,
expectToSaveChanges,
waitForToast,
} from '#src/ui-helpers/index.js';
} from '#src/page-helpers/index.js';
import { expectNavigation, appendPathname } from '#src/utils.js';
import {

View file

@ -7,7 +7,7 @@ import {
goToAdminConsole,
expectToSaveChanges,
waitForToast,
} from '#src/ui-helpers/index.js';
} from '#src/page-helpers/index.js';
import { expectNavigation, appendPathname } from '#src/utils.js';
import {

View file

@ -4,7 +4,7 @@ import {
expectToClickDetailsPageOption,
goToAdminConsole,
waitForToast,
} from '#src/ui-helpers/index.js';
} from '#src/page-helpers/index.js';
import {
expectNavigation,
appendPathname,

View file

@ -1,5 +1,5 @@
import { logtoConsoleUrl as logtoConsoleUrlString } from '#src/constants.js';
import { goToAdminConsole } from '#src/ui-helpers/index.js';
import { goToAdminConsole } from '#src/page-helpers/index.js';
import { expectNavigation, appendPathname } from '#src/utils.js';
import { waitForFormCard, expectToSelectColor, expectToSaveSignInExperience } from './helpers.js';

View file

@ -4,7 +4,7 @@ import {
expectToSaveChanges,
expectConfirmModalAndAct,
waitForToast,
} from '#src/ui-helpers/index.js';
} from '#src/page-helpers/index.js';
export const waitForFormCard = async (page: Page, title: string) => {
await expect(page).toMatchElement('div[class$=tabContent] div[class$=card] div[class$=title]', {

View file

@ -2,7 +2,7 @@ import { type Nullable } from '@silverhand/essentials';
import { type Page, type Target } from 'puppeteer';
import { logtoConsoleUrl as logtoConsoleUrlString, logtoUrl } from '#src/constants.js';
import { goToAdminConsole } from '#src/ui-helpers/index.js';
import { goToAdminConsole } from '#src/page-helpers/index.js';
import { expectNavigation, appendPathname } from '#src/utils.js';
import { expectToSelectPreviewLanguage, waitForFormCard } from './helpers.js';

View file

@ -2,7 +2,7 @@ import { ConnectorType } from '@logto/schemas';
import { type Page } from 'puppeteer';
import { logtoConsoleUrl as logtoConsoleUrlString } from '#src/constants.js';
import { expectToClickDetailsPageOption, waitForToast } from '#src/ui-helpers/index.js';
import { expectToClickDetailsPageOption, waitForToast } from '#src/page-helpers/index.js';
import { expectNavigation, appendPathname } from '#src/utils.js';
import {

View file

@ -1,5 +1,5 @@
import { logtoConsoleUrl as logtoConsoleUrlString } from '#src/constants.js';
import { expectToClickNavTab, goToAdminConsole } from '#src/ui-helpers/index.js';
import { expectToClickNavTab, goToAdminConsole } from '#src/page-helpers/index.js';
import { expectNavigation, appendPathname } from '#src/utils.js';
import { expectToSaveSignInExperience, waitForFormCard } from '../helpers.js';

View file

@ -3,7 +3,7 @@ import {
expectToClickNavTab,
goToAdminConsole,
expectToSaveChanges,
} from '#src/ui-helpers/index.js';
} from '#src/page-helpers/index.js';
import { expectNavigation, appendPathname } from '#src/utils.js';
import { expectToSaveSignInExperience, waitForFormCard } from '../helpers.js';

View file

@ -4,7 +4,7 @@ import {
expectToSaveChanges,
waitForToast,
expectToDiscardChanges,
} from '#src/ui-helpers/index.js';
} from '#src/page-helpers/index.js';
import {
appendPathname,
expectNavigation,

View file

@ -1,5 +1,5 @@
import { logtoConsoleUrl as logtoConsoleUrlString } from '#src/constants.js';
import { goToAdminConsole, expectToSaveChanges, waitForToast } from '#src/ui-helpers/index.js';
import { goToAdminConsole, expectToSaveChanges, waitForToast } from '#src/page-helpers/index.js';
import { appendPathname, expectNavigation } from '#src/utils.js';
await page.setViewport({ width: 1280, height: 720 });

View file

@ -0,0 +1,11 @@
/**
* NOTE: This test suite assumes test cases will run sequentially (which is Jest default).
* Parallel execution will lead to errors.
*/
// Tip: See https://github.com/argos-ci/jest-puppeteer/blob/main/packages/expect-puppeteer/README.md
// for convenient expect methods
describe('smoke testing for the main flow', () => {
it('should not explode', async () => {
expect(true);
});
});