mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-02 05:03:44 +08:00
Add test case for valid arguments
This commit is contained in:
parent
73fca95969
commit
64e0c74ada
@ -1,6 +1,16 @@
|
||||
import { lightenColor as lighten, darkenColor as darken } from '../utils';
|
||||
|
||||
describe('utils', () => {
|
||||
it('should apply polished when valid arguments are passed', () => {
|
||||
const lightColor = '#F6F9FC';
|
||||
const darkColor = '#2f2f2f';
|
||||
const darkenedColor = darken(lightColor);
|
||||
const lightenedColor = lighten(darkColor);
|
||||
|
||||
expect(darkenedColor).toEqual('rgba(0,0,0,0.95)');
|
||||
expect(lightenedColor).toEqual('rgba(255,255,255,0.95)');
|
||||
});
|
||||
|
||||
it('should guard non-string value is being passed to color of theme object', () => {
|
||||
const result = () => {
|
||||
return lighten(1234);
|
||||
|
Loading…
x
Reference in New Issue
Block a user