diff options
| author | Shinigami <[email protected]> | 2023-03-14 18:37:05 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-03-14 17:37:05 +0000 |
| commit | a0010900205ed8b1d1ba2adefe222c1cb41c1a70 (patch) | |
| tree | ca92e04bda028b7ab2d192287505404550b0c393 /test | |
| parent | b584038985a8e7cf6fcacb7ce94a38454c23a95a (diff) | |
| download | faker-a0010900205ed8b1d1ba2adefe222c1cb41c1a70.tar.xz faker-a0010900205ed8b1d1ba2adefe222c1cb41c1a70.zip | |
feat: provide enums for color values (#1910)
Diffstat (limited to 'test')
| -rw-r--r-- | test/__snapshots__/color.spec.ts.snap | 4 | ||||
| -rw-r--r-- | test/color.spec.ts | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/test/__snapshots__/color.spec.ts.snap b/test/__snapshots__/color.spec.ts.snap index 2d3ce303..a39ce0f3 100644 --- a/test/__snapshots__/color.spec.ts.snap +++ b/test/__snapshots__/color.spec.ts.snap @@ -19,7 +19,7 @@ exports[`color > 42 > colorByCSSColorSpace 1`] = ` exports[`color > 42 > cssSupportedFunction 1`] = `"hsla"`; -exports[`color > 42 > cssSupportedSpace 1`] = `"rec2020"`; +exports[`color > 42 > cssSupportedSpace 1`] = `"display-p3"`; exports[`color > 42 > hsl 1`] = ` [ @@ -78,7 +78,7 @@ exports[`color > 1211 > colorByCSSColorSpace 1`] = ` exports[`color > 1211 > cssSupportedFunction 1`] = `"color"`; -exports[`color > 1211 > cssSupportedSpace 1`] = `"rec2020"`; +exports[`color > 1211 > cssSupportedSpace 1`] = `"prophoto-rgb"`; exports[`color > 1211 > hsl 1`] = ` [ diff --git a/test/color.spec.ts b/test/color.spec.ts index 29ce63ed..3f4f04dd 100644 --- a/test/color.spec.ts +++ b/test/color.spec.ts @@ -1,6 +1,5 @@ import { describe, expect, it } from 'vitest'; -import { faker } from '../src'; -import { CSS_FUNCTIONS, CSS_SPACES } from '../src/modules/color'; +import { CssFunction, CssSpace, faker } from '../src'; import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 5; @@ -44,14 +43,14 @@ describe('color', () => { describe(`cssSupportedFunction()`, () => { it('should return random css supported color function from css functions array', () => { const func = faker.color.cssSupportedFunction(); - expect(CSS_FUNCTIONS).toContain(func); + expect(Object.values(CssFunction)).toContain(func); }); }); describe(`cssSupportedSpace()`, () => { it('should return random css supported color space from css spaces array', () => { const space = faker.color.cssSupportedSpace(); - expect(CSS_SPACES).toContain(space); + expect(Object.values(CssSpace)).toContain(space); }); }); |
