From bcbae0c2390d52a368e986eede5c4bc093bfb53f Mon Sep 17 00:00:00 2001 From: Aditya Agarwal Date: Wed, 11 Feb 2026 11:45:55 +0100 Subject: [PATCH 1/2] test: skip client.flagUser() integration test The client.flagUser() test requires moderation features to be enabled on the account. Skipping this test to prevent CI failures. --- test/integration/cloud/user_flag.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/cloud/user_flag.js b/test/integration/cloud/user_flag.js index 9a366dbe..1ff6736a 100644 --- a/test/integration/cloud/user_flag.js +++ b/test/integration/cloud/user_flag.js @@ -26,7 +26,7 @@ describe('User Flagging', () => { }); }); - describe('When flagging a user with client.flagUser()', () => { + describe.skip('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', { From 15a2477fdd3ca4882ee68bc05b6832e6d0f54644 Mon Sep 17 00:00:00 2001 From: Aditya Agarwal Date: Wed, 11 Feb 2026 11:49:37 +0100 Subject: [PATCH 2/2] test: conditionally run user flagging tests based on APP_ID Only run user flagging tests when APP_ID is 16792 (account with moderation enabled). This prevents test failures in environments without moderation features (e.g., StreamAPI repo). Tests will: - Run on APP_ID 16792 (moderation enabled) - Skip on other APP_IDs (moderation not enabled) --- test/integration/cloud/user_flag.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/integration/cloud/user_flag.js b/test/integration/cloud/user_flag.js index 1ff6736a..78bdc6f5 100644 --- a/test/integration/cloud/user_flag.js +++ b/test/integration/cloud/user_flag.js @@ -1,13 +1,19 @@ 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. +// Only run these tests on accounts with moderation enabled (APP_ID 16792). +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 +32,7 @@ describe('User Flagging', () => { }); }); - describe.skip('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 +43,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({