Skip to content

Commit

Permalink
Set a default form_id for the subscribe pattern for testing (#1689)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebeby authored Mar 28, 2022
1 parent 9cedd5b commit c82e75d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/subscribe/subscribe.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import { withBrowser, getAccessibilityTree } from 'pleasantest';
import { loadTwigTemplate, loadGlobalCSS } from '../../../test-utils';

// Helper to load the Twig template file
const componentMarkup = loadTwigTemplate(
path.join(__dirname, './subscribe.twig')
);
const componentMarkup = (args = {}) =>
loadTwigTemplate(path.join(__dirname, './subscribe.twig'))({
form_id: 'example-form',
...args,
});
// Helper to load the demo Twig template file
const demoMarkup = loadTwigTemplate(path.join(__dirname, './demo/demo.twig'));

Expand Down Expand Up @@ -74,7 +76,7 @@ describe('Subscription', () => {
heading "Get Weekly Digests"
text "Get Weekly Digests"
text "Email"
textbox
textbox "Email"
button "Subscribe"
`);
})
Expand Down

0 comments on commit c82e75d

Please sign in to comment.