Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
rmccar committed Nov 21, 2023
1 parent b6406d9 commit febdca6
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/components/details/details.spec.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
import { renderComponent, setTestPage } from '../../tests/helpers/rendering';
import { renderComponent, renderTemplate, setTestPage } from '../../tests/helpers/rendering';

const EXAMPLE_DETAILS_BASIC = {
id: 'details-id',
title: 'Title for details',
content: 'Content for details',
};

const EXAMPLE_DETAILS_BASIC_2 = {
id: 'details-id-2',
title: 'Title for details',
content: 'Content for details',
};
const EXAMPLE_PAGE = `
${renderComponent('details', {
id: 'details-id',
title: 'Title for details',
content: 'Content for details',
})}
${renderComponent('details', {
id: 'details-id-2',
title: 'Title for details',
content: 'Content for details',
})}
`;

const RENDERED_EXAMPLE_PAGE = renderTemplate(EXAMPLE_PAGE);

describe('script: details', () => {
it('begins open when specified', async () => {
Expand Down Expand Up @@ -49,7 +59,7 @@ describe('script: details', () => {

describe('when there is more than one details component and a details heading is clicked to open the details', () => {
beforeEach(async () => {
await setTestPage('/test', (renderComponent('details', EXAMPLE_DETAILS_BASIC), renderComponent('details', EXAMPLE_DETAILS_BASIC_2)));
await setTestPage('/test', RENDERED_EXAMPLE_PAGE);
await page.click('#details-id > .ons-js-details-heading');
});

Expand Down

0 comments on commit febdca6

Please sign in to comment.