Skip to content

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

@jwir3

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.

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