mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
test: integration tests for sign-in experience (#1633)
This commit is contained in:
parent
a258587b4e
commit
23d793bb20
1 changed files with 39 additions and 0 deletions
39
packages/integration-tests/tests/sign-in-experience.test.ts
Normal file
39
packages/integration-tests/tests/sign-in-experience.test.ts
Normal file
|
@ -0,0 +1,39 @@
|
|||
import { BrandingStyle, SignInExperience } from '@logto/schemas';
|
||||
|
||||
import { authedAdminApi } from '@/api';
|
||||
|
||||
describe('admin console sign-in experience', () => {
|
||||
it('should get sign-in experience successfully', async () => {
|
||||
const signInExperience = await authedAdminApi.get('sign-in-exp').json<SignInExperience>();
|
||||
|
||||
expect(signInExperience).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should update sign-in experience successfully', async () => {
|
||||
const newSignInExperience: Partial<SignInExperience> = {
|
||||
color: {
|
||||
primaryColor: '#ffffff',
|
||||
darkPrimaryColor: '#000000',
|
||||
isDarkModeEnabled: true,
|
||||
},
|
||||
branding: {
|
||||
style: BrandingStyle.Logo_Slogan,
|
||||
slogan: 'Logto Slogan',
|
||||
logoUrl: 'https://logto.io/new-logo.png',
|
||||
darkLogoUrl: 'https://logto.io/new-dark-logo.png',
|
||||
},
|
||||
termsOfUse: {
|
||||
enabled: true,
|
||||
contentUrl: 'https://logto.io/terms',
|
||||
},
|
||||
};
|
||||
|
||||
const updatedSignInExperience = await authedAdminApi
|
||||
.patch('sign-in-exp', {
|
||||
json: newSignInExperience,
|
||||
})
|
||||
.json<SignInExperience>();
|
||||
|
||||
expect(updatedSignInExperience).toMatchObject(newSignInExperience);
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue