0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-20 21:32:31 -05:00

refactor(core): fix test

This commit is contained in:
Gao Sun 2023-03-17 15:24:52 +08:00
parent e0fad2dccd
commit 680b555c70
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
2 changed files with 10 additions and 5 deletions

View file

@ -1,9 +1,6 @@
import type { SignInExperience, CreateSignInExperience } from '@logto/schemas';
import { pickDefault, createMockUtils } from '@logto/shared/esm';
import { MockTenant } from '#src/test-utils/tenant.js';
import { createRequester } from '#src/utils/test-utils.js';
import {
mockFacebookConnector,
mockGithubConnector,
@ -20,6 +17,8 @@ import {
mockPrivacyPolicyUrl,
mockDemoSocialConnector,
} from '#src/__mocks__/index.js';
import { MockTenant } from '#src/test-utils/tenant.js';
import { createRequester } from '#src/utils/test-utils.js';
const { jest } = import.meta;
const { mockEsmWithActual } = createMockUtils(jest);
@ -57,8 +56,12 @@ const mockDeleteConnectorById = jest.fn();
const tenantContext = new MockTenant(
undefined,
{ signInExperiences, customPhrases: { findAllCustomLanguageTags: async () => [] } },
{ getLogtoConnectors: async () => logtoConnectors },
{
signInExperiences,
customPhrases: { findAllCustomLanguageTags: async () => [] },
connectors: { deleteConnectorById: mockDeleteConnectorById },
},
{ getLogtoConnectors: mockGetLogtoConnectors },
{ signInExperiences: { validateLanguageInfo } }
);

View file

@ -62,6 +62,8 @@ export default function signInExperiencesRoutes<T extends AuthedRouter>(
)
);
console.log('???', socialSignInConnectorTargets, filteredSocialSignInConnectorTargets);
if (signUp) {
validateSignUp(signUp, connectors);
}