Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Siggery committed Nov 29, 2024
1 parent 6ff9eb6 commit e955c28
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions apps/pie-storybook/test/utilities/index.test.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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<TemplateResult> = {
strings: Object.assign(['\n <pie-component size=', ' variant=', '></pie-component>\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', () => {
Expand Down

0 comments on commit e955c28

Please sign in to comment.