Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(color-picker): Added VR tests for ColorSlider and AlphaSlider #33672

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
ValentinaKozlova marked this conversation as resolved.
Show resolved Hide resolved
import type { Meta } from '@storybook/react';
import { ColorPicker } from '@fluentui/react-color-picker-preview';
import { ColorPicker, ColorSlider, AlphaSlider } from '@fluentui/react-color-picker-preview';
import { SampleColorPicker } from './utils';
import { Steps } from 'storywright';

Expand All @@ -15,6 +15,22 @@ export default {

export const Default = () => <SampleColorPicker color={{ h: 109, s: 1, v: 0.91 }} />;

export const ColorSliders = () => (
<>
<ColorSlider color={{ h: 109, s: 1, v: 0.9 }} />
<ColorSlider color={{ h: 184, s: 1, v: 0.9 }} vertical />
</>
);

export const AlphaSliders = () => (
<>
<AlphaSlider color={{ h: 12, s: 1, v: 0.9, a: 0.7 }} />
<AlphaSlider color={{ h: 59, s: 1, v: 1 }} vertical />
<AlphaSlider color={{ h: 276, s: 1, v: 0.9, a: 0.2 }} transparency />
<AlphaSlider color={{ h: 332, s: 1, v: 0.9, a: 0.1 }} transparency vertical />
</>
);

export const DefaultDarkMode = getStoryVariant(Default, DARK_MODE);

export const DefaultHighContrast = getStoryVariant(Default, HIGH_CONTRAST);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,24 @@ import {
ColorSlider,
type ColorPickerProps,
} from '@fluentui/react-color-picker-preview';
import { makeStyles } from '@griffel/react';

export const SampleColorPicker = (props: ColorPickerProps) => (
<ColorPicker {...props}>
<ColorArea />
<ColorSlider />
<AlphaSlider />
</ColorPicker>
);
const useStyles = makeStyles({
example: {
width: '300px',
display: 'flex',
flexDirection: 'column',
gap: '8px',
},
});

export const SampleColorPicker = (props: ColorPickerProps) => {
const styles = useStyles();
return (
<ColorPicker className={styles.example} {...props}>
<ColorArea />
<ColorSlider />
<AlphaSlider />
</ColorPicker>
);
};
Loading