Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

chore: remove error message when select an item of dropdown #2602

Merged
merged 3 commits into from Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -75,6 +75,11 @@ describe("CreateProfile", () => {

expect(showOpenDialogMock).toHaveBeenCalledWith(showOpenDialogParams);

// Trigger field errors
await act(async () => {
fireEvent.click(getByTestId("CreateProfile__submit-button"));
});

fireEvent.input(getByTestId("Input"), { target: { value: "test profile" } });
fireEvent.click(getAllByTestId("select-list__toggle-button")[0]);
fireEvent.click(getByTestId("select-list__toggle-option-0"));
Expand Down
10 changes: 10 additions & 0 deletions src/domains/profile/pages/CreateProfile/CreateProfile.tsx
Expand Up @@ -160,6 +160,11 @@ export const CreateProfile = () => {
}).toString(),
})}
options={PlatformSdkChoices.marketProviders}
onChange={() => {
if (form.errors.marketProvider) {
form.clearError("marketProvider");
}
}}
/>
<FormHelperText />
</FormField>
Expand All @@ -176,6 +181,11 @@ export const CreateProfile = () => {
}).toString(),
})}
options={PlatformSdkChoices.currencies}
onChange={() => {
if (form.errors.currency) {
form.clearError("currency");
}
}}
/>
<FormHelperText />
</FormField>
Expand Down
Expand Up @@ -187,18 +187,18 @@ exports[`CreateProfile should not upload avatar image 1`] = `
<button
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-42-label downshift-42-toggle-button"
aria-labelledby="downshift-48-label downshift-48-toggle-button"
class="sc-fznxsB hwZFkF is-selected "
data-testid="select-list__toggle-button"
id="downshift-42-toggle-button"
id="downshift-48-toggle-button"
type="button"
>
CoinCap
</button>
<ul
aria-labelledby="downshift-42-label"
aria-labelledby="downshift-48-label"
class="sc-fznJRM jFPFlO"
id="downshift-42-menu"
id="downshift-48-menu"
role="listbox"
tabindex="-1"
/>
Expand Down Expand Up @@ -248,18 +248,18 @@ exports[`CreateProfile should not upload avatar image 1`] = `
<button
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-43-label downshift-43-toggle-button"
aria-labelledby="downshift-49-label downshift-49-toggle-button"
class="sc-fznxsB hwZFkF is-selected "
data-testid="select-list__toggle-button"
id="downshift-43-toggle-button"
id="downshift-49-toggle-button"
type="button"
>
BTC (Ƀ)
</button>
<ul
aria-labelledby="downshift-43-label"
aria-labelledby="downshift-49-label"
class="sc-fznJRM jFPFlO"
id="downshift-43-menu"
id="downshift-49-menu"
role="listbox"
tabindex="-1"
/>
Expand Down Expand Up @@ -1342,18 +1342,18 @@ exports[`CreateProfile should upload and remove avatar image 1`] = `
<button
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-24-label downshift-24-toggle-button"
aria-labelledby="downshift-30-label downshift-30-toggle-button"
class="sc-fznxsB hwZFkF is-selected "
data-testid="select-list__toggle-button"
id="downshift-24-toggle-button"
id="downshift-30-toggle-button"
type="button"
>
CoinCap
</button>
<ul
aria-labelledby="downshift-24-label"
aria-labelledby="downshift-30-label"
class="sc-fznJRM jFPFlO"
id="downshift-24-menu"
id="downshift-30-menu"
role="listbox"
tabindex="-1"
/>
Expand Down Expand Up @@ -1403,18 +1403,18 @@ exports[`CreateProfile should upload and remove avatar image 1`] = `
<button
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-25-label downshift-25-toggle-button"
aria-labelledby="downshift-31-label downshift-31-toggle-button"
class="sc-fznxsB hwZFkF is-selected "
data-testid="select-list__toggle-button"
id="downshift-25-toggle-button"
id="downshift-31-toggle-button"
type="button"
>
BTC (Ƀ)
</button>
<ul
aria-labelledby="downshift-25-label"
aria-labelledby="downshift-31-label"
class="sc-fznJRM jFPFlO"
id="downshift-25-menu"
id="downshift-31-menu"
role="listbox"
tabindex="-1"
/>
Expand Down