-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix focus ring doesn't show up when Dropdown is wrapped in Form Field (…
- Loading branch information
Showing
3 changed files
with
42 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@salt-ds/lab": patch | ||
--- | ||
|
||
Fix focus ring doesn't show up when Dropdown is wrapped in Form Field |
17 changes: 17 additions & 0 deletions
17
packages/lab/src/__tests__/__e2e__/dropdown/Dropdown.cy.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Dropdown, FormField } from "@salt-ds/lab"; | ||
|
||
const testSource = ["Bar", "Foo", "Foo Bar", "Baz"]; | ||
|
||
describe("GIVEN a Dropdown component", () => { | ||
describe("WHEN the Dropdown is rendered within FormField", () => { | ||
it("THEN it should show focus ring around form field when focused", () => { | ||
cy.mount( | ||
<FormField label="Dropdown" id="dropdown-in-form-field"> | ||
<Dropdown source={testSource} /> | ||
</FormField> | ||
); | ||
cy.findByLabelText("Dropdown").focus(); | ||
cy.get(".saltFormField").should("have.class", "saltFormField-focused"); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters