Skip to content

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

Description

@jwir3

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions