mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
test(core): Skip SMTP tests if service unavailable (#3293)
This commit is contained in:
@@ -27,6 +27,7 @@ let globalMemberRole: Role;
|
||||
let globalOwnerRole: Role;
|
||||
let workflowOwnerRole: Role;
|
||||
let credentialOwnerRole: Role;
|
||||
let isSmtpAvailable = false;
|
||||
|
||||
beforeAll(async () => {
|
||||
app = utils.initTestServer({ endpointGroups: ['users'], applyAuth: true });
|
||||
@@ -47,6 +48,8 @@ beforeAll(async () => {
|
||||
|
||||
utils.initTestTelemetry();
|
||||
utils.initTestLogger();
|
||||
|
||||
isSmtpAvailable = await utils.isTestSmtpServiceAvailable();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
@@ -482,6 +485,8 @@ test('POST /users should fail if user management is disabled', async () => {
|
||||
test(
|
||||
'POST /users should email invites and create user shells but ignore existing',
|
||||
async () => {
|
||||
if (!isSmtpAvailable) utils.skipSmtpTest(expect);
|
||||
|
||||
const owner = await testDb.createUser({ globalRole: globalOwnerRole });
|
||||
const member = await testDb.createUser({ globalRole: globalMemberRole });
|
||||
const memberShell = await testDb.createUserShell(globalMemberRole);
|
||||
@@ -534,6 +539,8 @@ test(
|
||||
test(
|
||||
'POST /users should fail with invalid inputs',
|
||||
async () => {
|
||||
if (!isSmtpAvailable) utils.skipSmtpTest(expect);
|
||||
|
||||
const owner = await testDb.createUser({ globalRole: globalOwnerRole });
|
||||
const authOwnerAgent = utils.createAgent(app, { auth: true, user: owner });
|
||||
|
||||
@@ -563,6 +570,8 @@ test(
|
||||
test(
|
||||
'POST /users should ignore an empty payload',
|
||||
async () => {
|
||||
if (!isSmtpAvailable) utils.skipSmtpTest(expect);
|
||||
|
||||
const owner = await testDb.createUser({ globalRole: globalOwnerRole });
|
||||
const authOwnerAgent = utils.createAgent(app, { auth: true, user: owner });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user