Skip to content

Commit 8627c32

Browse files
authored
Merge branch 'main' into eng-696-adding-to-stack-fails-when-stack-has-50-items
2 parents 8a6485a + e4dc0da commit 8627c32

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

__tests__/integrations/feed.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,18 @@ describe('FeedPreferencesConfigGenerator', () => {
394394
defaultEnabledState: true,
395395
options: { type: 'news' },
396396
},
397+
{
398+
title: 'Social',
399+
group: 'content_types',
400+
description: '',
401+
defaultEnabledState: true,
402+
options: { type: PostType.SocialTwitter },
403+
},
397404
]);
398405
await con.getRepository(FeedAdvancedSettings).save([
399406
{ feedId: '1', advancedSettingsId: 1, enabled: false },
400407
{ feedId: '1', advancedSettingsId: 2, enabled: true },
408+
{ feedId: '1', advancedSettingsId: 4, enabled: false },
401409
]);
402410
});
403411

@@ -432,7 +440,7 @@ describe('FeedPreferencesConfigGenerator', () => {
432440
followed_sources: expect.arrayContaining(['c', 'p']),
433441
followed_user_ids: expect.arrayContaining(['2', '3']),
434442
allowed_post_types: postTypes.filter(
435-
(x) => x !== PostType.VideoYouTube,
443+
(x) => x !== PostType.VideoYouTube && x !== PostType.SocialTwitter,
436444
),
437445
feed_config_name: FeedConfigName.Personalise,
438446
fresh_page_size: '1',
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { MigrationInterface, QueryRunner } from 'typeorm';
2+
3+
export class SocialContentTypeAdvancedSetting1770400000000
4+
implements MigrationInterface
5+
{
6+
name = 'SocialContentTypeAdvancedSetting1770400000000';
7+
8+
public async up(queryRunner: QueryRunner): Promise<void> {
9+
await queryRunner.query(
10+
`INSERT INTO advanced_settings
11+
("title", "description", "group", "options")
12+
VALUES
13+
('Social', 'Posts from social platforms, including tweets and threads shared on daily.dev.', 'content_types', '{"type": "social:twitter"}')`,
14+
);
15+
}
16+
17+
public async down(queryRunner: QueryRunner): Promise<void> {
18+
await queryRunner.query(
19+
`DELETE FROM advanced_settings
20+
WHERE "title" = 'Social'
21+
AND "group" = 'content_types'
22+
AND options->>'type' = 'social:twitter'`,
23+
);
24+
}
25+
}

0 commit comments

Comments
 (0)