Skip to content

Commit

Permalink
Make E2E props more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
drwpow committed Mar 21, 2019
1 parent 1cbc48e commit 62e5d4b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/plan-details/plan-details.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,14 @@ describe(`<plan-details>`, () => {
it('renders mf-select if string feature present', async () => {
const page = await newE2EPage({ html: `<plan-details />` });

const props = { plan: stringPlan, product: Product };
await page.$eval(
'plan-details',
(elm: any, { plan, product }: any) => {
elm.plan = plan;
elm.product = product;
},
{ plan: stringPlan, product: Product }
props
);

await page.waitForChanges();
Expand All @@ -76,13 +77,14 @@ describe(`<plan-details>`, () => {
it('renders mf-slider if number feature present', async () => {
const page = await newE2EPage({ html: `<plan-details />` });

const props = { plan: numberPlan, product: Product };
await page.$eval(
'plan-details',
(elm: any, { plan, product }: any) => {
elm.plan = plan;
elm.product = product;
},
{ plan: numberPlan, product: Product }
props
);

await page.waitForChanges();
Expand All @@ -94,13 +96,14 @@ describe(`<plan-details>`, () => {
it('renders mf-toggle if boolean feature present', async () => {
const page = await newE2EPage({ html: `<plan-details />` });

const props = { plan: numberPlan, product: Product };
await page.$eval(
'plan-details',
(elm: any, { plan, product }: any) => {
elm.plan = plan;
elm.product = product;
},
{ plan: booleanPlan, product: Product }
props
);

await page.waitForChanges();
Expand Down

0 comments on commit 62e5d4b

Please sign in to comment.