@thepalaceproject/circulation-admin 1.25.0 → 1.26.0-post.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { render, screen } from "@testing-library/react";
|
|
3
|
+
import userEvent from "@testing-library/user-event";
|
|
4
|
+
import ProtocolFormField from "../../../src/components/ProtocolFormField";
|
|
5
|
+
|
|
6
|
+
// NB: This file adds / duplicates existing tests from:
|
|
7
|
+
// - `src/components/__tests__/ProtocolFormField-test.tsx`.
|
|
8
|
+
//
|
|
9
|
+
// Those tests should eventually be migrated here and
|
|
10
|
+
// adapted to the Jest/React Testing Library paradigm.
|
|
11
|
+
|
|
12
|
+
describe("ProtocolFormField", () => {
|
|
13
|
+
it("renders date-picker setting", async () => {
|
|
14
|
+
const user = userEvent.setup();
|
|
15
|
+
const emptyValue = "";
|
|
16
|
+
const testDate = "2022-01-01";
|
|
17
|
+
const datePickerLabel = "A date setting field";
|
|
18
|
+
const fieldDescription = "Description of the setting";
|
|
19
|
+
const setting = {
|
|
20
|
+
key: "setting",
|
|
21
|
+
label: datePickerLabel,
|
|
22
|
+
description: `<p>${fieldDescription}</p>`,
|
|
23
|
+
type: "date-picker",
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
render(<ProtocolFormField setting={setting} disabled={false} />);
|
|
27
|
+
const input = screen.getByLabelText(datePickerLabel) as HTMLInputElement;
|
|
28
|
+
|
|
29
|
+
expect(input.value).toBe(emptyValue);
|
|
30
|
+
|
|
31
|
+
// Enter a date.
|
|
32
|
+
await user.click(input);
|
|
33
|
+
await user.keyboard(`${testDate}{enter}`);
|
|
34
|
+
|
|
35
|
+
expect(input.value).toBe(testDate);
|
|
36
|
+
screen.debug();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -192,11 +192,11 @@ module.exports = (env) => {
|
|
|
192
192
|
return responseBuffer;
|
|
193
193
|
}
|
|
194
194
|
),
|
|
195
|
-
proxyTimeout:
|
|
195
|
+
proxyTimeout: 120000,
|
|
196
196
|
secure: false,
|
|
197
197
|
selfHandleResponse: true,
|
|
198
198
|
target: backend,
|
|
199
|
-
timeout:
|
|
199
|
+
timeout: 120000,
|
|
200
200
|
});
|
|
201
201
|
|
|
202
202
|
const config = merge(dev, {
|