Skip to content

Commit

Permalink
test: expanded property
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioCastigliano committed Jan 9, 2024
1 parent 218a036 commit 04546f8
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/components/container/sticky-bar/sticky-bar.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { assert, fixture, expect } from '@open-wc/testing';
import { setViewport } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';

import { waitForCondition } from '../../core/testing';
import { waitForCondition, waitForLitRender } from '../../core/testing';
import { SbbContainerElement } from '../container';

import { SbbStickyBarElement } from './sticky-bar';
Expand Down Expand Up @@ -61,4 +61,26 @@ describe('sbb-sticky-bar', () => {

expect(getSettled()).to.equal(true);
});

it('renders with expanded layout', async () => {
container = await fixture(html`
<sbb-container expanded>
<button>Container button</button>
<sbb-sticky-bar>
<button>Sticky bar button</button>
</sbb-sticky-bar>
</sbb-container>
`);
stickyBar = container.querySelector('sbb-sticky-bar');

expect(stickyBar).to.have.attribute('data-expanded');
});

it('expands the sticky-bar when container is expanded', async () => {
container.expanded = true;

await waitForLitRender(container);

expect(stickyBar).to.have.attribute('data-expanded');
});
});

0 comments on commit 04546f8

Please sign in to comment.