diff --git a/test/integration/cloud/user_flag.js b/test/integration/cloud/user_flag.js index 9a366dbe..af514068 100644 --- a/test/integration/cloud/user_flag.js +++ b/test/integration/cloud/user_flag.js @@ -1,13 +1,20 @@ import expect from 'expect.js'; import { CloudContext } from './utils'; +import config from '../utils/config'; + +// User flagging requires moderation features to be enabled on the Stream account. +// APP_ID 16792 has moderation enabled. Other test apps (e.g., from StreamAPI CI) +// have moderation disabled, so we skip these tests there. +const shouldRunModerationTests = config.APP_ID === '16792'; +const describeOrSkip = shouldRunModerationTests ? describe : describe.skip; describe('User Flagging', () => { const ctx = new CloudContext(); ctx.createUsers(); - describe('When creating activities to establish users in moderation system', () => { + describeOrSkip('When creating activities to establish users in moderation system', () => { ctx.requestShouldNotError(async () => { // Create activities with users as actors to establish them in the moderation system // Using user1 and user2 which are commonly used across integration tests @@ -26,7 +33,7 @@ describe('User Flagging', () => { }); }); - describe('When flagging a user with client.flagUser()', () => { + describeOrSkip('When flagging a user with client.flagUser()', () => { ctx.requestShouldNotError(async () => { // Flag user1 (which exists in the moderation system from other tests) ctx.response = await ctx.serverSideClient.flagUser('user1', { @@ -37,7 +44,7 @@ describe('User Flagging', () => { }); }); - describe('When flagging using user.flag()', () => { + describeOrSkip('When flagging using user.flag()', () => { ctx.requestShouldNotError(async () => { // Flag using the user object method ctx.response = await ctx.serverSideClient.user('user1').flag({