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
[Listbox] Hide input that documentation claims is hidden #570
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -197,6 +197,10 @@ describe("<Listbox />", () => { | |
</Listbox> | ||
); | ||
expect(container.querySelector("input")).toBeTruthy(); | ||
expect(container.querySelector("input")).toHaveAttribute( | ||
"type", | ||
"hidden" | ||
); | ||
}); | ||
}); | ||
|
||
|
@@ -218,7 +222,12 @@ describe("<Listbox />", () => { | |
</Listbox> | ||
</div> | ||
); | ||
expect(container.querySelector("input")).toBeTruthy(); | ||
// Be careful not to match the `input[type=text]` added in this test | ||
expect(container.querySelector("input[type=hidden]")).toBeTruthy(); | ||
expect(container.querySelector("input[type=hidden]")).toHaveAttribute( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's remove these assertions, see comment above about future implementation changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure. Do you mean restoring the test to how it was? Or just removing all assertions in this test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, we can revert these lines to the one line from before. Let's just keep the check for a standard input and use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are 2 inputs, the first added by the test ( So the test you propose fails. Do you like this option which will work to get that second input?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went ahead and pushed that up along with fixing the other line. |
||
"form", | ||
"my-form" | ||
); | ||
}); | ||
}); | ||
|
||
|
@@ -232,6 +241,10 @@ describe("<Listbox />", () => { | |
</Listbox> | ||
); | ||
expect(container.querySelector("input")).toBeTruthy(); | ||
expect(container.querySelector("input")).toHaveAttribute( | ||
"type", | ||
"hidden" | ||
); | ||
expect(container.querySelector("input")).toHaveAttribute("required"); | ||
}); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we instead test that the input is visibly hidden with
expect(container.querySelector("input")).not.toBeVisible()
? I'll probably change the implementation of this in the near future to address arrow form navigation on iOS.