Skip to content

Commit c940c3b

Browse files
Merge pull request #451 from primeroIMS/trigyn-testcases-pages-admin-form-builder-components-translations-form
Trigyn testcases pages admin form builder components translations form
2 parents 05e63fd + fde43de commit c940c3b

File tree

2 files changed

+34
-60
lines changed

2 files changed

+34
-60
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { fromJS } from "immutable";
2+
3+
import { mountedFormComponent, screen } from "../../../../../../test-utils";
4+
5+
import TranslationsForm from "./component";
6+
7+
describe("<TranslationsForm />", () => {
8+
const state = fromJS({
9+
application: { locales: ["en", "fr", "ar"] },
10+
records: {
11+
admin: {
12+
forms: {
13+
selectedFields: [
14+
{
15+
name: "field_1",
16+
display_name: { en: "Field 1" }
17+
},
18+
{
19+
name: "field_2",
20+
display_name: { en: "Field 2" }
21+
}
22+
]
23+
}
24+
}
25+
}
26+
});
27+
28+
it("should render <TranslationsForm />", () => {
29+
mountedFormComponent(<TranslationsForm mode="new" />, state);
30+
expect(screen.queryAllByText("Select language")).toHaveLength(2);
31+
expect(screen.getByText("forms.label")).toBeInTheDocument();
32+
expect(screen.getByText("fields.label")).toBeInTheDocument();
33+
});
34+
});

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

-60
This file was deleted.

0 commit comments

Comments
 (0)