Skip to content

Commit

Permalink
test: attempt fix a flaky test (#2129)
Browse files Browse the repository at this point in the history
  • Loading branch information
omBratteng authored Aug 13, 2024
1 parent 4546745 commit f5fcc1a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
20 changes: 0 additions & 20 deletions __tests__/__snapshots__/feeds.ts.snap
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`function feedToFilters should return filters for tags/sources based on the values from our data 1`] = `
Object {
"blockedContentCuration": Array [],
"blockedTags": Array [
"golang",
],
"excludeSources": Array [
"b",
"c",
"fd062672-63b7-4a10-87bd-96dcd10e9613",
],
"excludeTypes": Array [],
"includeTags": Array [
"html",
"javascript",
],
"sourceIds": Array [],
}
`;

exports[`function feedToFilters should return filters with blocked content types 1`] = `
Object {
"blockedContentCuration": Array [
Expand Down
19 changes: 18 additions & 1 deletion __tests__/feeds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2328,7 +2328,24 @@ describe('function feedToFilters', () => {
it('should return filters for tags/sources based on the values from our data', async () => {
loggedUser = '1';
await saveFeedFixtures();
expect(await feedToFilters(con, '1', '1')).toMatchSnapshot();
const filters = await feedToFilters(con, '1', '1');
expect(filters.blockedContentCuration).toEqual([]);
expect(filters.excludeTypes).toEqual([]);
expect(filters.sourceIds).toEqual([]);
expect(filters.includeTags).toEqual(
expect.arrayContaining(['html', 'javascript']),
);
expect(filters.includeTags?.length).toBe(2);
expect(filters.blockedTags).toEqual(expect.arrayContaining(['golang']));
expect(filters.blockedTags?.length).toBe(1);
expect(filters.excludeSources).toEqual(
expect.arrayContaining([
'b',
'c',
'fd062672-63b7-4a10-87bd-96dcd10e9613',
]),
);
expect(filters.excludeSources?.length).toBe(3);
});

it('should return filters with source memberships', async () => {
Expand Down

0 comments on commit f5fcc1a

Please sign in to comment.