From bcbae0c2390d52a368e986eede5c4bc093bfb53f Mon Sep 17 00:00:00 2001 From: Aditya Agarwal Date: Wed, 11 Feb 2026 11:45:55 +0100 Subject: [PATCH 1/5] 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/5] 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({ From 6583f5e4d32d6f3375538675ae2a051abfdd2d61 Mon Sep 17 00:00:00 2001 From: Aditya Agarwal Date: Wed, 11 Feb 2026 11:53:27 +0100 Subject: [PATCH 3/5] docs: explain why moderation tests are conditional Add comment explaining that APP_ID 6743 (default test app) can't have moderation enabled as it would break other existing tests. This is why we conditionally run moderation tests only on APP_ID 16792. --- test/integration/cloud/user_flag.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/integration/cloud/user_flag.js b/test/integration/cloud/user_flag.js index 78bdc6f5..594346dc 100644 --- a/test/integration/cloud/user_flag.js +++ b/test/integration/cloud/user_flag.js @@ -5,6 +5,10 @@ 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). +// +// Note: We can't enable moderation on the default test app (6743) because it would +// break other existing tests that rely on moderation being disabled. Therefore, +// we conditionally run these tests only on APP_ID 16792 which has moderation enabled. const shouldRunModerationTests = config.APP_ID === '16792'; const describeOrSkip = shouldRunModerationTests ? describe : describe.skip; From ae6f7cb80c3d0a5ecb83645615444f1285522b5f Mon Sep 17 00:00:00 2001 From: Aditya Agarwal Date: Wed, 11 Feb 2026 11:54:44 +0100 Subject: [PATCH 4/5] docs: simplify moderation test comment Remove internal implementation details and keep it professional. Just state that these tests require moderation features. --- test/integration/cloud/user_flag.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/integration/cloud/user_flag.js b/test/integration/cloud/user_flag.js index 594346dc..f0a12884 100644 --- a/test/integration/cloud/user_flag.js +++ b/test/integration/cloud/user_flag.js @@ -4,11 +4,7 @@ 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). -// -// Note: We can't enable moderation on the default test app (6743) because it would -// break other existing tests that rely on moderation being disabled. Therefore, -// we conditionally run these tests only on APP_ID 16792 which has moderation enabled. +// These tests run only on test accounts with moderation enabled (APP_ID 16792). const shouldRunModerationTests = config.APP_ID === '16792'; const describeOrSkip = shouldRunModerationTests ? describe : describe.skip; From 7fb34f65e18108d4f0c2c713a7e96b796c77c03e Mon Sep 17 00:00:00 2001 From: Aditya Agarwal Date: Wed, 11 Feb 2026 11:55:24 +0100 Subject: [PATCH 5/5] docs: clarify why moderation tests are conditional Explain that APP_ID 16792 has moderation enabled, while other test apps (e.g., StreamAPI CI) have it disabled, hence the conditional skip. --- test/integration/cloud/user_flag.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/integration/cloud/user_flag.js b/test/integration/cloud/user_flag.js index f0a12884..af514068 100644 --- a/test/integration/cloud/user_flag.js +++ b/test/integration/cloud/user_flag.js @@ -4,7 +4,8 @@ import { CloudContext } from './utils'; import config from '../utils/config'; // User flagging requires moderation features to be enabled on the Stream account. -// These tests run only on test accounts with moderation enabled (APP_ID 16792). +// 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;