Skip to content

Commit

Permalink
Merge branch 'master' into 108-indicate-if-a-user-is-disconnected
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiloAschebrock authored Sep 15, 2023
2 parents e871fb7 + 18b0a6c commit 6d808a8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 8 additions & 1 deletion frontend/src/Components/ScaleSelector/ScaleSelector.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ describe('The ScaleSelector', () => {
'Fibonacci',
'Cohen',
'Fixed Ratio',
'Linear',
'Sizes',
]);
expect(getSelectedOptions(dropdown)).toEqual(['Cohen']);
Expand Down Expand Up @@ -121,6 +122,9 @@ describe('The ScaleSelector', () => {
fireEvent.keyDown(dropdown, { code: 'ArrowDown' });
expect(getSelectedOptions(dropdown)).toEqual(['Fixed Ratio']);

fireEvent.keyDown(dropdown, { code: 'ArrowDown' });
expect(getSelectedOptions(dropdown)).toEqual(['Linear']);

fireEvent.keyDown(dropdown, { code: 'ArrowDown' });
expect(getSelectedOptions(dropdown)).toEqual(['Sizes']);

Expand All @@ -130,6 +134,9 @@ describe('The ScaleSelector', () => {
fireEvent.keyDown(dropdown, { code: 'ArrowUp' });
expect(getSelectedOptions(dropdown)).toEqual(['Sizes']);

fireEvent.keyDown(dropdown, { code: 'ArrowUp' });
expect(getSelectedOptions(dropdown)).toEqual(['Linear']);

fireEvent.keyDown(dropdown, { code: 'ArrowUp' });
expect(getSelectedOptions(dropdown)).toEqual(['Fixed Ratio']);

Expand Down Expand Up @@ -186,7 +193,7 @@ describe('The ScaleSelector', () => {
expect(getSelectedOptions(dropdown)).toEqual(['Sizes']);

fireEvent.keyDown(dropdown, { code: 'ArrowUp' });
expect(getSelectedOptions(dropdown)).toEqual(['Fixed Ratio']);
expect(getSelectedOptions(dropdown)).toEqual(['Linear']);

fireEvent.mouseMove(getByText('Sizes'));
fireEvent.mouseLeave(getByText('Sizes'));
Expand Down
6 changes: 5 additions & 1 deletion shared/scales.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CardValue, SIZES_ORDERED, SPECIAL_VALUES_ORDERED } from './cards';

export type ScaleName = 'FIBONACCI_SCALE' | 'COHEN_SCALE' | 'FIXED_RATIO_SCALE' | 'SIZES_SCALE';
export type ScaleName = 'FIBONACCI_SCALE' | 'COHEN_SCALE' | 'FIXED_RATIO_SCALE' | 'LINEAR_SCALE' | 'SIZES_SCALE';

export const SCALES: { [id in ScaleName]: { name: string; values: Array<CardValue> } } = {
FIBONACCI_SCALE: {
Expand Down Expand Up @@ -28,5 +28,9 @@ export const SCALES: { [id in ScaleName]: { name: string; values: Array<CardValu
name: 'Fixed Ratio',
values: ['1', '2', '4', '8', '16', '32', '64', '128', ...SPECIAL_VALUES_ORDERED],
},
LINEAR_SCALE: {
name: 'Linear',
values: ['0', '1', '2', '3', '4', '5', ...SPECIAL_VALUES_ORDERED],
},
SIZES_SCALE: { name: 'Sizes', values: [...SIZES_ORDERED, ...SPECIAL_VALUES_ORDERED] },
};

0 comments on commit 6d808a8

Please sign in to comment.