Skip to content

Commit 7e7b192

Browse files
test: stabilize storage settings reactivity emojis/sounds tests (#39172)
1 parent c57c262 commit 7e7b192

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

apps/meteor/app/settings/server/CachedSettings.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,15 @@ export class CachedSettings
181181
const settings = _id.map((id) => this.store.get(id)?.value);
182182
callback(settings as T[]);
183183
}
184-
const mergeFunction = _.debounce((): void => {
185-
callback(_id.map((id) => this.store.get(id)?.value) as T[]);
186-
}, 100);
184+
185+
const mergeFunction =
186+
process.env.TEST_MODE !== 'true'
187+
? _.debounce((): void => {
188+
callback(_id.map((id) => this.store.get(id)?.value) as T[]);
189+
}, 100)
190+
: (): void => {
191+
callback(_id.map((id) => this.store.get(id)?.value) as T[]);
192+
};
187193

188194
const fns = _id.map((id) => this.on(id, mergeFunction));
189195
return (): void => {

apps/meteor/tests/end-to-end/api/custom-sounds.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,15 +260,14 @@ describe('[CustomSounds]', () => {
260260
let gridFsFileId: string;
261261

262262
before(async () => {
263+
await updateSetting('CustomSounds_FileSystemPath', '', false);
263264
await updateSetting('CustomSounds_Storage_Type', 'FileSystem');
264265
fsFileId = await insertOrUpdateSound(`${fileName}-3`);
265266
await uploadCustomSound(binary, `${fileName}-3`, fsFileId);
266267

267268
await updateSetting('CustomSounds_Storage_Type', 'GridFS');
268269
gridFsFileId = await insertOrUpdateSound(`${fileName}-4`);
269270
await uploadCustomSound(binary, `${fileName}-4`, gridFsFileId);
270-
271-
await updateSetting('CustomSounds_FileSystemPath', '');
272271
});
273272

274273
after(async () => {

apps/meteor/tests/end-to-end/api/emoji-custom.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,13 +497,12 @@ describe('[EmojiCustom]', () => {
497497
</svg>`);
498498

499499
before(async () => {
500+
await updateSetting('EmojiUpload_FileSystemPath', '', false);
500501
await updateSetting('EmojiUpload_Storage_Type', 'FileSystem');
501502
await request.post(api('emoji-custom.create')).set(credentials).attach('emoji', imgURL).field({ name: fsEmojiName }).expect(200);
502503

503504
await updateSetting('EmojiUpload_Storage_Type', 'GridFS');
504505
await request.post(api('emoji-custom.create')).set(credentials).attach('emoji', imgURL).field({ name: gridFsEmojiName }).expect(200);
505-
506-
await updateSetting('EmojiUpload_FileSystemPath', '');
507506
});
508507

509508
after(async () => {

0 commit comments

Comments
 (0)