mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
test(core): Use instance owner instead of owner shell for SAML tests (no-changelog) (#5706)
Use instance owner instead of owner shell
This commit is contained in:
parent
9bd7529193
commit
3718612bd7
|
@ -37,11 +37,11 @@ afterAll(async () => {
|
||||||
await testDb.terminate();
|
await testDb.terminate();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Owner shell', () => {
|
describe('Instance owner', () => {
|
||||||
test('PATCH /me should succeed with valid inputs', async () => {
|
test('PATCH /me should succeed with valid inputs', async () => {
|
||||||
const ownerShell = await testDb.createUserShell(globalOwnerRole);
|
const owner = await testDb.createOwner();
|
||||||
const authOwnerShellAgent = authAgent(ownerShell);
|
const authOwnerAgent = authAgent(owner);
|
||||||
const response = await authOwnerShellAgent.patch('/me').send({
|
const response = await authOwnerAgent.patch('/me').send({
|
||||||
email: randomEmail(),
|
email: randomEmail(),
|
||||||
firstName: randomName(),
|
firstName: randomName(),
|
||||||
lastName: randomName(),
|
lastName: randomName(),
|
||||||
|
@ -52,9 +52,9 @@ describe('Owner shell', () => {
|
||||||
|
|
||||||
test('PATCH /me should throw BadRequestError if email is changed when SAML is enabled', async () => {
|
test('PATCH /me should throw BadRequestError if email is changed when SAML is enabled', async () => {
|
||||||
enableSaml(true);
|
enableSaml(true);
|
||||||
const ownerShell = await testDb.createUserShell(globalOwnerRole);
|
const owner = await testDb.createOwner();
|
||||||
const authOwnerShellAgent = authAgent(ownerShell);
|
const authOwnerAgent = authAgent(owner);
|
||||||
const response = await authOwnerShellAgent.patch('/me').send({
|
const response = await authOwnerAgent.patch('/me').send({
|
||||||
email: randomEmail(),
|
email: randomEmail(),
|
||||||
firstName: randomName(),
|
firstName: randomName(),
|
||||||
lastName: randomName(),
|
lastName: randomName(),
|
||||||
|
@ -66,9 +66,9 @@ describe('Owner shell', () => {
|
||||||
|
|
||||||
test('PATCH /password should throw BadRequestError if password is changed when SAML is enabled', async () => {
|
test('PATCH /password should throw BadRequestError if password is changed when SAML is enabled', async () => {
|
||||||
enableSaml(true);
|
enableSaml(true);
|
||||||
const ownerShell = await testDb.createUserShell(globalOwnerRole);
|
const owner = await testDb.createOwner();
|
||||||
const authOwnerShellAgent = authAgent(ownerShell);
|
const authOwnerAgent = authAgent(owner);
|
||||||
const response = await authOwnerShellAgent.patch('/me/password').send({
|
const response = await authOwnerAgent.patch('/me/password').send({
|
||||||
password: randomValidPassword(),
|
password: randomValidPassword(),
|
||||||
});
|
});
|
||||||
expect(response.statusCode).toBe(400);
|
expect(response.statusCode).toBe(400);
|
||||||
|
|
Loading…
Reference in a new issue