Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2EElement is missing removeAttribute()/toggleAttribute() #1745

Closed
jcfranco opened this issue Jul 18, 2019 · 0 comments
Closed

E2EElement is missing removeAttribute()/toggleAttribute() #1745

jcfranco opened this issue Jul 18, 2019 · 0 comments

Comments

@jcfranco
Copy link
Contributor

jcfranco commented Jul 18, 2019

Stencil version:

 @stencil/core@one

I'm submitting a:

[ ] bug report
[x] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/

Current behavior:

There is no way to remove boolean attributes with the existing E2EElement APIs. This is particularly problematic if your test involves a native element that has a boolean attribute that is not reflected via its matching property (e.g., input#checked).

Expected behavior:

E2EElement should provide the necessary APIs for the following type of test:

it("should react when input#checked changes", async () => {
  const page = await newE2EPage();
  await page.setContent(
    "<my-component><input type='radio' slot='radio' value='1' checked></my-component>"
  );

  const element = await page.find("my-component");
  const radio = await page.find("my-component >>> input[slot=radio]");

  let checked = await element.getProperty("checked");
  expect(checked).toBeTruthy();

  radio.removeAttribute("checked"); // or toggleAttribute

  checked = await element.getProperty("checked");
  expect(checked).toBeFalsy();
});

Steps to reproduce:

See ☝️.

Related code:

See ☝️.

Other information:

N/A

@ionitron-bot ionitron-bot bot added the triage label Jul 18, 2019
@jcfranco jcfranco changed the title E2EElement is missing removeAttribute() E2EElement is missing removeAttribute()/toggleAttribute() Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants