From e955c2873cc778d599b7c671d2f990ae74fe8094 Mon Sep 17 00:00:00 2001 From: Ben Siggery Date: Fri, 29 Nov 2024 11:48:06 +0000 Subject: [PATCH] update test --- apps/pie-storybook/test/utilities/index.test.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/pie-storybook/test/utilities/index.test.ts b/apps/pie-storybook/test/utilities/index.test.ts index 11d33cfc36..6c0f33c4ab 100644 --- a/apps/pie-storybook/test/utilities/index.test.ts +++ b/apps/pie-storybook/test/utilities/index.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from 'vitest'; -import { html, render } from 'lit'; +import { html, render, type TemplateResult} from 'lit'; import { createStory, createVariantStory } from '../../utilities/index'; import { type StoryOptions } from '../../types/StoryOptions'; @@ -19,7 +19,17 @@ describe('createStory', () => { const result = story(); expect(result.args).toEqual(defaultArgs); - expect(result.render(defaultArgs)).toHaveProperty('strings'); + + const actualTemplateResult = result.render(defaultArgs); + + const expectedTemplateResult: Partial = { + strings: Object.assign(['\n \n']), + values: ['medium', 'primary'] + }; + + // Compare the key properties of the TemplateResult + expect(actualTemplateResult.strings).toEqual(expectedTemplateResult.strings); + expect(actualTemplateResult.values).toEqual(expectedTemplateResult.values); }); it('should override default args with prop overrides', () => {