From 0c9dd8b0a530f60aae4ec8bed6180b65afcce6be Mon Sep 17 00:00:00 2001 From: Lukas Oppermann Date: Mon, 9 Dec 2024 12:50:00 +0100 Subject: [PATCH] fix tests --- src/transformers/colorAlphaToCss.test.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/transformers/colorAlphaToCss.test.ts b/src/transformers/colorAlphaToCss.test.ts index fe695c333..d7bbbf04f 100644 --- a/src/transformers/colorAlphaToCss.test.ts +++ b/src/transformers/colorAlphaToCss.test.ts @@ -1,3 +1,4 @@ +import {TransformedToken} from 'style-dictionary/types' import {getMockToken} from '../test-utilities/index.js' import {colorAlphaToCss} from './colorAlphaToCss.js' @@ -9,7 +10,7 @@ describe('Transformer: colorAlphaToCss', () => { getMockToken({$value: '#34343455'}), ] const expectedOutput = ['#123', '#343434', '#34343455'] - expect(input.map(item => colorAlphaToCss.transform(item, {}, {}))).toStrictEqual(expectedOutput) + expect(input.map(item => colorAlphaToCss.transform(item as TransformedToken, {}, {}))).toStrictEqual(expectedOutput) }) it('transforms hex3, hex6, hex8 `color` tokens with alpha value', () => { @@ -19,11 +20,11 @@ describe('Transformer: colorAlphaToCss', () => { getMockToken({$value: '#34343466', alpha: 0.1}), ] const expectedOutput = [ - 'color-mix(#123, transparent 25%)', - 'color-mix(#343434, transparent 60%)', - 'color-mix(#34343466, transparent 10%)', + 'color-mix(in srgb, #123, transparent 25%)', + 'color-mix(in srgb, #343434, transparent 60%)', + 'color-mix(in srgb, #34343466, transparent 10%)', ] - expect(input.map(item => colorAlphaToCss.transform(item, {}, {}))).toStrictEqual(expectedOutput) + expect(input.map(item => colorAlphaToCss.transform(item as TransformedToken, {}, {}))).toStrictEqual(expectedOutput) }) it('transforms references with and without alpha value', () => { @@ -31,7 +32,7 @@ describe('Transformer: colorAlphaToCss', () => { getMockToken({$value: '{base.color.green.5}'}), getMockToken({$value: '{base.color.red.5}', alpha: 0.25}), ] - const expectedOutput = ['{base.color.green.5}', 'color-mix({base.color.red.5}, transparent 25%)'] - expect(input.map(item => colorAlphaToCss.transform(item, {}, {}))).toStrictEqual(expectedOutput) + const expectedOutput = ['{base.color.green.5}', 'color-mix(in srgb, {base.color.red.5}, transparent 25%)'] + expect(input.map(item => colorAlphaToCss.transform(item as TransformedToken, {}, {}))).toStrictEqual(expectedOutput) }) })