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

Test issue: Calling ComponentBehaviors.getInstance() prior to the first it test in password.spec.js causes failure #7

Open
jwir3 opened this issue Apr 19, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@jwir3
Copy link
Contributor

jwir3 commented Apr 19, 2020

The following test:

    it ('should switch the icon when the show password icon is clicked', () => {
      // TODO_jwir3: There's a bug here. If ComponentBehaviors.getInstance() is
      // called one or more times _BEFORE_ this test, then the test fails.

      let eyeIcon = document.getElementById('eye-icon-password');
      expect(eyeIcon).not.toBeNull();

      eyeIcon.click();

      eyeIcon = document.getElementById('eye-icon-password');
      expect(eyeIcon).not.toBeNull();
      expect(_.values(eyeIcon.classList)).toEqual(expect.arrayContaining(['fa-eye-slash']));
    });

Fails if there is any test that runs before it in the same block. It might be because the password reveal indicator is having multiple handlers added to it, but it's unclear. It doesn't seem to be reproducible in the examples.

@jwir3 jwir3 added the bug Something isn't working label Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant