Skip to content

Commit

Permalink
add test story
Browse files Browse the repository at this point in the history
  • Loading branch information
JesmoDev committed Oct 27, 2023
1 parent a7b3379 commit fabcbb5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
31 changes: 31 additions & 0 deletions packages/uui-popover-container/lib/popover-test-story.element.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
import { css, html, LitElement } from 'lit';
/**
* @element popover-test-story
*/
@defineElement('popover-test-story')
export class UUIPopoverTestStoryElement extends LitElement {
render() {
return html`
<uui-button look="primary" popovertarget="my-popover"
>open popover</uui-button
>
<uui-popover-container id="my-popover" popover>
<div style="width: 200px; border: 1px solid black">
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Repudiandae
quis eos doloribus dolore. Voluptate dolorum, natus, sit veritatis
impedit dolore enim odio excepturi ex nostrum veniam repellendus
obcaecati aspernatur dolorem.
</div>
</uui-popover-container>
`;
}

static styles = [css``];
}

declare global {
interface HTMLElementTagNameMap {
'popover-test-story': UUIPopoverTestStoryElement;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import type { UUIPopoverContainerElement } from './uui-popover-container.element
import readme from '../README.md?raw';
import { html } from 'lit';

import './popover-test-story.element';

const meta: Meta<UUIPopoverContainerElement> = {
id: 'uui-popover-container',
title: 'Displays/Popover Container',
Expand All @@ -19,6 +21,10 @@ const meta: Meta<UUIPopoverContainerElement> = {
export default meta;
type Story = StoryObj<UUIPopoverContainerElement>;

export const Test: Story = {
render: () => html`<popover-test-story></popover-test-story>`,
};

export const Overview: Story = {
play: async ({ canvasElement }) => {
const button = canvasElement.querySelector('#popover-button');
Expand Down

0 comments on commit fabcbb5

Please sign in to comment.