Skip to content

Commit

Permalink
test: Update test variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel.carrera committed Nov 5, 2024
1 parent fd45cc0 commit 86db1d6
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions modules/react/collection/spec/useOverflowModel.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,83 +2,83 @@ import {getHiddenIds} from '../lib/useOverflowListModel';

describe('useOverflowModel', () => {
describe('getHiddenIds', () => {
const itemWidthCache = {
const itemSizeCache = {
first: 100,
second: 150,
third: 200,
fourth: 250,
};
const overflowTargetWidth = 100;
const overflowTargeSize = 100;

[
{
containerWidth: 100,
containerSize: 100,
gap: 0,
selected: 'first',
hiddenIds: ['first', 'second', 'third', 'fourth'],
},
{
containerWidth: 199,
containerSize: 199,
gap: 0,
selected: 'first',
hiddenIds: ['first', 'second', 'third', 'fourth'],
},
{
containerWidth: 200,
containerSize: 200,
gap: 0,
selected: 'first',
hiddenIds: ['second', 'third', 'fourth'],
},
{containerWidth: 700, gap: 0, selected: 'first', hiddenIds: []},
{containerWidth: 350, gap: 0, selected: 'first', hiddenIds: ['third', 'fourth']},
{containerWidth: 549, gap: 0, selected: 'first', hiddenIds: ['third', 'fourth']},
{containerWidth: 550, gap: 0, selected: 'first', hiddenIds: ['fourth']},
{containerSize: 700, gap: 0, selected: 'first', hiddenIds: []},
{containerSize: 350, gap: 0, selected: 'first', hiddenIds: ['third', 'fourth']},
{containerSize: 549, gap: 0, selected: 'first', hiddenIds: ['third', 'fourth']},
{containerSize: 550, gap: 0, selected: 'first', hiddenIds: ['fourth']},
{
containerWidth: 250,
containerSize: 250,
gap: 0,
selected: 'second',
hiddenIds: ['first', 'third', 'fourth'],
},
// gap
{
containerWidth: 100,
containerSize: 100,
gap: 10,
selected: 'first',
hiddenIds: ['first', 'second', 'third', 'fourth'],
},
{
containerWidth: 199,
containerSize: 199,
gap: 10,
selected: 'first',
hiddenIds: ['first', 'second', 'third', 'fourth'],
},
{
containerWidth: 200,
containerSize: 200,
gap: 10,
selected: 'first',
hiddenIds: ['second', 'third', 'fourth'],
},
{containerWidth: 729, gap: 10, selected: 'first', hiddenIds: ['fourth']},
{containerWidth: 730, gap: 10, selected: 'first', hiddenIds: []},
{containerWidth: 360, gap: 10, selected: 'first', hiddenIds: ['third', 'fourth']},
{containerWidth: 559, gap: 10, selected: 'first', hiddenIds: ['third', 'fourth']},
{containerWidth: 570, gap: 10, selected: 'first', hiddenIds: ['fourth']},
{containerSize: 729, gap: 10, selected: 'first', hiddenIds: ['fourth']},
{containerSize: 730, gap: 10, selected: 'first', hiddenIds: []},
{containerSize: 360, gap: 10, selected: 'first', hiddenIds: ['third', 'fourth']},
{containerSize: 559, gap: 10, selected: 'first', hiddenIds: ['third', 'fourth']},
{containerSize: 570, gap: 10, selected: 'first', hiddenIds: ['fourth']},
{
containerWidth: 250,
containerSize: 250,
gap: 10,
selected: 'second',
hiddenIds: ['first', 'third', 'fourth'],
},
].forEach(({containerWidth, hiddenIds, gap, selected}) => {
it(`when containerWidth is ${containerWidth} and selected is '${selected}' should contain hiddenIds [${hiddenIds.join(
].forEach(({containerSize, hiddenIds, gap, selected}) => {
it(`when containerSize is ${containerSize} and selected is '${selected}' should contain hiddenIds [${hiddenIds.join(
', '
)}] `, () => {
expect(
getHiddenIds(
containerWidth,
containerSize,
gap,
overflowTargetWidth,
itemWidthCache,
overflowTargeSize,
itemSizeCache,
[selected],
[
{id: 'first', value: 'first', index: 0, textValue: 'first'},
Expand Down

0 comments on commit 86db1d6

Please sign in to comment.