Skip to content

Commit 4986e49

Browse files
committed
Resolved PR Comments
1 parent efb0d4d commit 4986e49

File tree

1 file changed

+10
-7
lines changed
  • app/javascript/components/pages/admin/form-builder/components/translations-form

1 file changed

+10
-7
lines changed

app/javascript/components/pages/admin/form-builder/components/translations-form/component.spec.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { fromJS } from "immutable";
22

3-
import { mountedFormComponent, screen } from "../../../../../../test-utils";
3+
import { mountedFormComponent, screen, userEvent } from "../../../../../../test-utils";
44

55
import TranslationsForm from "./component";
66

@@ -25,14 +25,17 @@ describe("<TranslationsForm />", () => {
2525
}
2626
});
2727

28-
2928
it("should render <TranslationsForm />", () => {
30-
mountedFormComponent(<TranslationsForm mode="new" />, state)
31-
expect(screen.getByText('forms.label')).toBeInTheDocument();
29+
mountedFormComponent(<TranslationsForm mode="new" />, state);
30+
expect(screen.getByText("forms.label")).toBeInTheDocument();
3231
});
3332

34-
it("should update name and description if the translation are updated", () => {
35-
mountedFormComponent(<TranslationsForm mode="new" />, state)
36-
expect(screen.getAllByRole('textbox')).toHaveLength(3);
33+
it("should update name and description if the translation are updated", async () => {
34+
const user = userEvent.setup();
35+
36+
mountedFormComponent(<TranslationsForm mode="new" />, state);
37+
await user.type(screen.getAllByRole("textbox")[0], "name");
38+
await user.type(screen.getAllByRole("textbox")[1], "description");
39+
expect(screen.getAllByRole("textbox")[1]).toHaveValue("description");
3740
});
3841
});

0 commit comments

Comments
 (0)