mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): Standardize filename casing for services and Public API (no-changelog) (#10579)
This commit is contained in:
44
packages/cli/test/integration/saml/saml-helpers.test.ts
Normal file
44
packages/cli/test/integration/saml/saml-helpers.test.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import * as helpers from '@/sso/saml/saml-helpers';
|
||||
import type { SamlUserAttributes } from '@/sso/saml/types/saml-user-attributes';
|
||||
import { getPersonalProject } from '../shared/db/projects';
|
||||
|
||||
import * as testDb from '../shared/test-db';
|
||||
|
||||
beforeAll(async () => {
|
||||
await testDb.init();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await testDb.terminate();
|
||||
});
|
||||
|
||||
describe('sso/saml/samlHelpers', () => {
|
||||
describe('createUserFromSamlAttributes', () => {
|
||||
test('Creates personal project for user', async () => {
|
||||
//
|
||||
// ARRANGE
|
||||
//
|
||||
const samlUserAttributes: SamlUserAttributes = {
|
||||
firstName: 'Nathan',
|
||||
lastName: 'Nathaniel',
|
||||
email: 'n@8.n',
|
||||
userPrincipalName: 'Huh?',
|
||||
};
|
||||
|
||||
//
|
||||
// ACT
|
||||
//
|
||||
const user = await helpers.createUserFromSamlAttributes(samlUserAttributes);
|
||||
|
||||
//
|
||||
// ASSERT
|
||||
//
|
||||
expect(user).toMatchObject({
|
||||
firstName: samlUserAttributes.firstName,
|
||||
lastName: samlUserAttributes.lastName,
|
||||
email: samlUserAttributes.email,
|
||||
});
|
||||
await expect(getPersonalProject(user)).resolves.not.toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user