0
Fork 0
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:
Xiao Yijun 2022-07-21 15:32:21 +08:00 committed by GitHub
parent a258587b4e
commit 23d793bb20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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);
});
});