Skip to content

Commit

Permalink
Add skeleton tests for flex general layout function
Browse files Browse the repository at this point in the history
Co-authored-by: Charlotte Emms <charlotte.emms@guardian.co.uk>
Co-authored-by: Georges Lebreton <georges.lebreton@guardian.co.uk>
  • Loading branch information
3 people committed Sep 18, 2024
1 parent 80389e6 commit 64b7684
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions dotcom-rendering/src/components/FlexibleGeneral.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { trails } from 'fixtures/manual/trails';
import { determineCardPositions } from './FlexibleGeneral';
import { DCRFrontCard } from 'src/types/front';

Check failure on line 3 in dotcom-rendering/src/components/FlexibleGeneral.test.tsx

View workflow job for this annotation

GitHub Actions / lint / check

'src/types/front' import is restricted from being used by a pattern. Paths starting with “src/” are forbidden. Please use a relative path instead

Check failure on line 3 in dotcom-rendering/src/components/FlexibleGeneral.test.tsx

View workflow job for this annotation

GitHub Actions / lint / check

All imports in the declaration are only used as types. Use `import type`

Check failure on line 3 in dotcom-rendering/src/components/FlexibleGeneral.test.tsx

View workflow job for this annotation

GitHub Actions / lint / check

`src/types/front` import should occur before import of `./FlexibleGeneral`

const standardCard = {
...trails[0],
boostLevel: 'default',
} satisfies DCRFrontCard;

const boostedCard = {
...trails[0],
boostLevel: 'boost',
} satisfies DCRFrontCard;

describe('FlexibleGeneral', () => {
it.skip('Should return a one card half width row if one standard card is provided', () => {
expect(determineCardPositions([standardCard])).toEqual([]);
});
it.skip('Should return a one full half width row if one standard boosted card is provided', () => {
expect(determineCardPositions([boostedCard])).toEqual([]);
});
it.skip('Should return a two card row if two standard cards are provided', () => {
expect(determineCardPositions([standardCard, standardCard])).toEqual(
[],
);
});
});

0 comments on commit 64b7684

Please sign in to comment.