[Vuejs]-Vue Unit test Input value not set

5👍

It should work:

it("Incorrect login pops up", async () => {
  const userTextInputIncorrect = wrapper.find("#userNameTextInput");
  await userTextInputIncorrect.setValue("wrongPass");

  expect(
    (userTextInputIncorrect.element as HTMLInputElement).value
  ).toContain("incorrectName");
});

Leave a comment