refactor(core): Extract SAML requests payloads into DTOs (#12435)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-01-03 11:05:30 +01:00
committed by GitHub
parent 2241eef8cf
commit 552cff1860
29 changed files with 535 additions and 354 deletions

View File

@@ -34,6 +34,8 @@ beforeAll(async () => {
authMemberAgent = testServer.authAgentFor(someUser);
});
beforeEach(async () => await enableSaml(false));
describe('Instance owner', () => {
describe('PATCH /me', () => {
test('should succeed with valid inputs', async () => {
@@ -89,6 +91,17 @@ describe('Instance owner', () => {
.expect(200);
expect(getCurrentAuthenticationMethod()).toBe('saml');
});
test('should return 400 on invalid config', async () => {
await authOwnerAgent
.post('/sso/saml/config')
.send({
...sampleConfig,
loginBinding: 'invalid',
})
.expect(400);
expect(getCurrentAuthenticationMethod()).toBe('email');
});
});
describe('POST /sso/saml/config/toggle', () => {