@pega/custom-dx-components 0.25.7 → 0.25.9
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 +1 -1
- package/src/tasks/build-jest-assets/index.js +2 -2
- package/src/tasks/create/templates/Constellation/Field/Boolean/config.json.mustache +25 -0
- package/src/tasks/create/templates/Constellation/Field/Date/config.json.mustache +25 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/config.json.mustache +25 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/config.json.mustache +25 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/config.json.mustache +25 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/config.json.mustache +25 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/config.json.mustache +25 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/config.json.mustache +25 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/config.json.mustache +25 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/config.json.mustache +25 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/config.json.mustache +25 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/config.json.mustache +25 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/config.json.mustache +25 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/config.json.mustache +25 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/config.json.mustache +25 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/config.json.mustache +25 -0
- package/src/tasks/init/template/package.json.mustache +2 -2
- package/tests/assets/library/components/create/Pega_DXIL_MyTestText/demo.test.tsx +19 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyBoolean/config.json +25 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyBoolean/demo.test.tsx +19 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.tsx +5 -4
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.test.tsx +28 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCurrency/config.json +25 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCurrency/demo.test.tsx +23 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDate/config.json +25 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDate/demo.stories.tsx +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDate/demo.test.tsx +52 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDateTime/config.json +25 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDateTime/demo.stories.tsx +3 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDateTime/demo.test.tsx +72 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDecimal/config.json +25 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDecimal/demo.test.tsx +21 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +4 -3
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.test.tsx +47 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyEmail/config.json +25 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyEmail/demo.test.tsx +20 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyForm/demo.test.tsx +40 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/demo.test.tsx +27 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyInteger/config.json +25 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyInteger/demo.test.tsx +18 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx +6 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/demo.test.tsx +24 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +4 -3
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/demo.test.tsx +29 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +4 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.test.tsx +36 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +4 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyParagraph/config.json +25 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyParagraph/demo.test.tsx +21 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPercentage/config.json +25 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPercentage/demo.test.tsx +18 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPhone/config.json +25 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPhone/demo.test.tsx +23 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/config.json +25 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/demo.test.tsx +25 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/config.json +25 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/demo.test.tsx +29 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/config.json +25 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/demo.test.tsx +33 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyText/demo.test.tsx +19 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTextInput/config.json +25 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTextInput/demo.test.tsx +20 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/config.json +25 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/demo.test.tsx +33 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +3 -3
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.test.tsx +58 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.test.tsx +56 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyURL/config.json +25 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyURL/demo.test.tsx +20 -0
- package/tests/assets/original/components/create/Pega_DXIL_MyTestText/demo.test.tsx +19 -0
- package/tests/assets/original/components/create/shared/Avatar.tsx +76 -0
- package/tests/assets/original/components/create/shared/Operator.tsx +215 -0
- package/tests/assets/original/components/create/shared/PConnProps.d.ts +46 -0
- package/tests/assets/original/components/create/shared/create-nonce.ts +6 -0
- package/tests/assets/original/components/create/shared/suggestions-handler.ts +9 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyBoolean/config.json +25 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyBoolean/demo.test.tsx +19 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.tsx +5 -4
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.test.tsx +28 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCurrency/config.json +25 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCurrency/demo.test.tsx +23 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDate/config.json +25 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDate/demo.stories.tsx +2 -2
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDate/demo.test.tsx +52 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDateTime/config.json +25 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDateTime/demo.stories.tsx +3 -2
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDateTime/demo.test.tsx +72 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDecimal/config.json +25 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDecimal/demo.test.tsx +21 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +4 -3
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.test.tsx +47 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyEmail/config.json +25 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyEmail/demo.test.tsx +20 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyForm/demo.test.tsx +40 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +2 -2
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/demo.test.tsx +27 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyInteger/config.json +25 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyInteger/demo.test.tsx +18 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx +6 -2
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/demo.test.tsx +24 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +4 -3
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/demo.test.tsx +29 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +4 -2
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.test.tsx +36 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +4 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyParagraph/config.json +25 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyParagraph/demo.test.tsx +21 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPercentage/config.json +25 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPercentage/demo.test.tsx +18 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPhone/config.json +25 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPhone/demo.test.tsx +23 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPicklist/config.json +25 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPicklist/demo.test.tsx +25 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/config.json +25 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/demo.test.tsx +29 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/config.json +25 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/demo.test.tsx +33 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyText/demo.test.tsx +19 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTextInput/config.json +25 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTextInput/demo.test.tsx +20 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/config.json +25 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/demo.test.tsx +33 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +3 -3
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.test.tsx +58 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.test.tsx +56 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyURL/config.json +25 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyURL/demo.test.tsx +20 -0
- package/tests/assets/original/components/createAll/Constellation/shared/Avatar.tsx +76 -0
- package/tests/assets/original/components/createAll/Constellation/shared/Operator.tsx +215 -0
- package/tests/assets/original/components/createAll/Constellation/shared/PConnProps.d.ts +46 -0
- package/tests/assets/original/components/createAll/Constellation/shared/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/shared/suggestions-handler.ts +9 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyBoolean/config.json +25 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyBoolean/demo.test.tsx +19 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/demo.stories.tsx +5 -4
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/demo.test.tsx +28 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCurrency/config.json +25 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCurrency/demo.test.tsx +23 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDate/config.json +25 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDate/demo.stories.tsx +2 -2
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDate/demo.test.tsx +52 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDateTime/config.json +25 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDateTime/demo.stories.tsx +3 -2
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDateTime/demo.test.tsx +72 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDecimal/config.json +25 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDecimal/demo.test.tsx +21 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.tsx +4 -3
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.test.tsx +47 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyEmail/config.json +25 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyEmail/demo.test.tsx +20 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyForm/demo.test.tsx +40 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +3 -2
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/demo.test.tsx +27 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyInteger/config.json +25 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyInteger/demo.test.tsx +18 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/demo.stories.tsx +6 -2
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/demo.test.tsx +24 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +4 -3
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/demo.test.tsx +19 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/demo.stories.tsx +4 -2
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/demo.test.tsx +36 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyParagraph/config.json +25 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyParagraph/demo.test.tsx +21 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPercentage/config.json +25 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPercentage/demo.test.tsx +18 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPhone/config.json +25 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPhone/demo.test.tsx +23 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/config.json +25 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/demo.test.tsx +25 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/config.json +25 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/demo.test.tsx +29 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/config.json +25 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/demo.test.tsx +33 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyText/demo.test.tsx +19 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTextInput/config.json +25 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTextInput/demo.test.tsx +20 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/config.json +25 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/demo.test.tsx +33 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +3 -3
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.test.tsx +58 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/demo.test.tsx +56 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyURL/config.json +25 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyURL/demo.test.tsx +20 -0
- package/tests/assets/original/components/createAll/Launchpad/shared/Avatar.tsx +76 -0
- package/tests/assets/original/components/createAll/Launchpad/shared/Operator.tsx +215 -0
- package/tests/assets/original/components/createAll/Launchpad/shared/PConnProps.d.ts +46 -0
- package/tests/assets/original/components/createAll/Launchpad/shared/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/shared/suggestions-handler.ts +9 -0
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.test.tsx
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// import { expect, test } from '@jest/globals';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { composeStories } from '@storybook/react';
|
|
4
|
+
import '@testing-library/jest-dom';
|
|
5
|
+
|
|
6
|
+
import * as DemoStories from './demo.stories';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const { BasePegaDxilMyCaseWidget } = composeStories(DemoStories);
|
|
11
|
+
|
|
12
|
+
test('renders PegaDxilMyCaseWidget', async () => {
|
|
13
|
+
render(<BasePegaDxilMyCaseWidget />);
|
|
14
|
+
|
|
15
|
+
const caseHistoryArr = await screen.findAllByText('Case history');
|
|
16
|
+
expect(caseHistoryArr[0]).toBeVisible();
|
|
17
|
+
expect(caseHistoryArr[1]).toBeVisible();
|
|
18
|
+
|
|
19
|
+
expect(await screen.findByText('Date')).toBeVisible();
|
|
20
|
+
expect(await screen.findByText('Description')).toBeVisible();
|
|
21
|
+
expect(await screen.findByText('Performed by')).toBeVisible();
|
|
22
|
+
|
|
23
|
+
const peformedArr = await screen.findAllByText('User DigV2');
|
|
24
|
+
expect(peformedArr[0]).toBeVisible();
|
|
25
|
+
expect(peformedArr[1]).toBeVisible();
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
});
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCurrency/config.json
CHANGED
|
@@ -17,6 +17,31 @@
|
|
|
17
17
|
"format": "TEXT",
|
|
18
18
|
"required": true
|
|
19
19
|
},
|
|
20
|
+
{
|
|
21
|
+
"name": "labelOption",
|
|
22
|
+
"label": "Field label",
|
|
23
|
+
"format": "SELECT",
|
|
24
|
+
"defaultValue": "custom",
|
|
25
|
+
"visibility": "@PLATFORMNAME != 'launchpad'",
|
|
26
|
+
"source": [
|
|
27
|
+
{
|
|
28
|
+
"key": "default",
|
|
29
|
+
"value": "Default"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"key": "custom",
|
|
33
|
+
"value": "Custom"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "label",
|
|
39
|
+
"label": "Custom field label",
|
|
40
|
+
"format": "VALUEINPUT",
|
|
41
|
+
"required": true,
|
|
42
|
+
"ruleType": "Paragraph",
|
|
43
|
+
"visibility": "@PLATFORMNAME != 'launchpad'"
|
|
44
|
+
},
|
|
20
45
|
{
|
|
21
46
|
"name": "readOnly",
|
|
22
47
|
"label": "Edit mode",
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCurrency/demo.test.tsx
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// import { expect, test } from '@jest/globals';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { composeStories } from '@storybook/react';
|
|
4
|
+
import '@testing-library/jest-dom';
|
|
5
|
+
|
|
6
|
+
import * as DemoStories from './demo.stories';
|
|
7
|
+
|
|
8
|
+
const { BasePegaDxilMyCurrency } = composeStories(DemoStories);
|
|
9
|
+
|
|
10
|
+
test('renders PegaDxilMyCurrency', async () => {
|
|
11
|
+
render(<BasePegaDxilMyCurrency />);
|
|
12
|
+
expect(await screen.findByText('Currency Sample')).toBeVisible();
|
|
13
|
+
expect(await screen.findByText('Currency Helper Text')).toBeVisible();
|
|
14
|
+
|
|
15
|
+
const currencyElement = screen.getByRole('textbox');
|
|
16
|
+
// for some odd reason, checking the full string of "USD 0.00" doesn't pass
|
|
17
|
+
// expect(currencyElement).toHaveValue('USD 0.00');
|
|
18
|
+
const myTextAreaVal = (screen.getByRole('textbox') as HTMLInputElement).value;
|
|
19
|
+
expect(myTextAreaVal).toContain('USD');
|
|
20
|
+
expect(myTextAreaVal).toContain('0.00');
|
|
21
|
+
|
|
22
|
+
expect(currencyElement).toHaveAttribute('placeholder', 'Currency Placeholder');
|
|
23
|
+
});
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDate/config.json
CHANGED
|
@@ -17,6 +17,31 @@
|
|
|
17
17
|
"format": "TEXT",
|
|
18
18
|
"required": true
|
|
19
19
|
},
|
|
20
|
+
{
|
|
21
|
+
"name": "labelOption",
|
|
22
|
+
"label": "Field label",
|
|
23
|
+
"format": "SELECT",
|
|
24
|
+
"defaultValue": "custom",
|
|
25
|
+
"visibility": "@PLATFORMNAME != 'launchpad'",
|
|
26
|
+
"source": [
|
|
27
|
+
{
|
|
28
|
+
"key": "default",
|
|
29
|
+
"value": "Default"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"key": "custom",
|
|
33
|
+
"value": "Custom"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "label",
|
|
39
|
+
"label": "Custom field label",
|
|
40
|
+
"format": "VALUEINPUT",
|
|
41
|
+
"required": true,
|
|
42
|
+
"ruleType": "Paragraph",
|
|
43
|
+
"visibility": "@PLATFORMNAME != 'launchpad'"
|
|
44
|
+
},
|
|
20
45
|
{
|
|
21
46
|
"name": "readOnly",
|
|
22
47
|
"label": "Edit mode",
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDate/demo.stories.tsx
CHANGED
|
@@ -15,7 +15,7 @@ export default meta;
|
|
|
15
15
|
type Story = StoryObj<typeof PegaDxilMyDate>;
|
|
16
16
|
|
|
17
17
|
if (!window.PCore) {
|
|
18
|
-
window.PCore = {};
|
|
18
|
+
window.PCore = {} as any;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
window.PCore.getEnvironmentInfo = () => {
|
|
@@ -26,7 +26,7 @@ window.PCore.getEnvironmentInfo = () => {
|
|
|
26
26
|
getLocale: () => {
|
|
27
27
|
return 'en-GB';
|
|
28
28
|
}
|
|
29
|
-
};
|
|
29
|
+
} as any;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
export const BasePegaDxilMyDate: Story = args => {
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDate/demo.test.tsx
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// import { expect, test } from '@jest/globals';
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { render, screen, fireEvent } from '@testing-library/react';
|
|
4
|
+
import { composeStories } from '@storybook/react';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
|
|
7
|
+
import * as DemoStories from './demo.stories';
|
|
8
|
+
|
|
9
|
+
const { BasePegaDxilMyDate } = composeStories(DemoStories);
|
|
10
|
+
|
|
11
|
+
test('renders PegaDxilMyDate', async () => {
|
|
12
|
+
render(<BasePegaDxilMyDate/>);
|
|
13
|
+
expect(await screen.findByText('Date Label')).toBeVisible();
|
|
14
|
+
expect(await screen.findByText('Date helper text')).toBeVisible();
|
|
15
|
+
|
|
16
|
+
// const dateElement = screen.getByRole('textbox');
|
|
17
|
+
// for some odd reason, checking the full string of "USD 0.00" doesn't pass
|
|
18
|
+
// expect(currencyElement).toHaveValue('USD 0.00');
|
|
19
|
+
const myMonth = (screen.getByTestId(':date-input:control-month') as HTMLInputElement);
|
|
20
|
+
expect(myMonth.value).toContain('01');
|
|
21
|
+
expect(myMonth).toHaveAttribute('placeholder', 'MM');
|
|
22
|
+
|
|
23
|
+
const myDay = (screen.getByTestId(':date-input:control-day') as HTMLInputElement);
|
|
24
|
+
expect(myDay.value).toContain('31');
|
|
25
|
+
expect(myDay).toHaveAttribute('placeholder', 'DD');
|
|
26
|
+
|
|
27
|
+
const myYear = (screen.getByTestId(':date-input:control-year') as HTMLInputElement);
|
|
28
|
+
expect(myYear.value).toContain('2023');
|
|
29
|
+
expect(myYear).toHaveAttribute('placeholder', 'YYYY');
|
|
30
|
+
|
|
31
|
+
// press clear button
|
|
32
|
+
const clearX = screen.getByTestId(':date-input:clear-current-date') as HTMLButtonElement;
|
|
33
|
+
fireEvent.click(clearX);
|
|
34
|
+
|
|
35
|
+
const myClearMonth = (screen.getByTestId(':date-input:control-month') as HTMLInputElement).value;
|
|
36
|
+
expect(myClearMonth).toContain('');
|
|
37
|
+
|
|
38
|
+
const myClearDay = (screen.getByTestId(':date-input:control-day') as HTMLInputElement).value;
|
|
39
|
+
expect(myClearDay).toContain('');
|
|
40
|
+
|
|
41
|
+
const myClearYear = (screen.getByTestId(':date-input:control-year') as HTMLInputElement).value;
|
|
42
|
+
expect(myClearYear).toContain('');
|
|
43
|
+
|
|
44
|
+
// press date picker
|
|
45
|
+
const pickerButton = screen.getByTestId(':date-input:open-close-picker') as HTMLButtonElement;
|
|
46
|
+
fireEvent.click(pickerButton);
|
|
47
|
+
|
|
48
|
+
// because need to wait after button pressed before finding the data picker pop up, need to do this
|
|
49
|
+
// via "await" and "findByTestId" (as opposed to getByTestId)
|
|
50
|
+
const dataPickerPopUp = await screen.findByTestId(':date-input:clear-current-date');
|
|
51
|
+
expect(dataPickerPopUp).not.toBeNull();
|
|
52
|
+
});
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDateTime/config.json
CHANGED
|
@@ -17,6 +17,31 @@
|
|
|
17
17
|
"format": "TEXT",
|
|
18
18
|
"required": true
|
|
19
19
|
},
|
|
20
|
+
{
|
|
21
|
+
"name": "labelOption",
|
|
22
|
+
"label": "Field label",
|
|
23
|
+
"format": "SELECT",
|
|
24
|
+
"defaultValue": "custom",
|
|
25
|
+
"visibility": "@PLATFORMNAME != 'launchpad'",
|
|
26
|
+
"source": [
|
|
27
|
+
{
|
|
28
|
+
"key": "default",
|
|
29
|
+
"value": "Default"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"key": "custom",
|
|
33
|
+
"value": "Custom"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "label",
|
|
39
|
+
"label": "Custom field label",
|
|
40
|
+
"format": "VALUEINPUT",
|
|
41
|
+
"required": true,
|
|
42
|
+
"ruleType": "Paragraph",
|
|
43
|
+
"visibility": "@PLATFORMNAME != 'launchpad'"
|
|
44
|
+
},
|
|
20
45
|
{
|
|
21
46
|
"name": "readOnly",
|
|
22
47
|
"label": "Edit mode",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
2
|
+
// @ts-nocheck
|
|
2
3
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
4
|
import { configProps, stateProps } from './mock';
|
|
4
5
|
import PegaDxilMyDateTime from './index';
|
|
@@ -14,7 +15,7 @@ type Story = StoryObj<typeof PegaDxilMyDateTime>;
|
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
if (!window.PCore) {
|
|
17
|
-
window.PCore = {};
|
|
18
|
+
window.PCore = {} as any;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
window.PCore.getEnvironmentInfo = () => {
|
|
@@ -25,7 +26,7 @@ window.PCore.getEnvironmentInfo = () => {
|
|
|
25
26
|
getLocale: () => {
|
|
26
27
|
return 'en-GB';
|
|
27
28
|
}
|
|
28
|
-
};
|
|
29
|
+
} as any;
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
export const BasePegaDxilMyDateTime: Story = (args: any) => {
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDateTime/demo.test.tsx
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// import { expect, test } from '@jest/globals';
|
|
2
|
+
import { render, screen, fireEvent } from '@testing-library/react';
|
|
3
|
+
import { composeStories } from '@storybook/react';
|
|
4
|
+
import '@testing-library/jest-dom';
|
|
5
|
+
|
|
6
|
+
import * as DemoStories from './demo.stories';
|
|
7
|
+
|
|
8
|
+
const { BasePegaDxilMyDateTime } = composeStories(DemoStories);
|
|
9
|
+
|
|
10
|
+
test('renders PegaDxilMyDateTime', async () => {
|
|
11
|
+
render(<BasePegaDxilMyDateTime/>);
|
|
12
|
+
expect(await screen.findByText('DateTime Label')).toBeVisible();
|
|
13
|
+
expect(await screen.findByText('DateTime helper text')).toBeVisible();
|
|
14
|
+
|
|
15
|
+
// const dateElement = screen.getByRole('textbox');
|
|
16
|
+
// for some odd reason, checking the full string of "USD 0.00" doesn't pass
|
|
17
|
+
// expect(currencyElement).toHaveValue('USD 0.00');
|
|
18
|
+
const myMonth = (screen.getByTestId(':date-time-input:control-month') as HTMLInputElement);
|
|
19
|
+
expect(myMonth.value).toContain('01');
|
|
20
|
+
expect(myMonth).toHaveAttribute('placeholder', 'MM');
|
|
21
|
+
|
|
22
|
+
const myDay = (screen.getByTestId(':date-time-input:control-day') as HTMLInputElement);
|
|
23
|
+
expect(myDay.value).toContain('24');
|
|
24
|
+
expect(myDay).toHaveAttribute('placeholder', 'DD');
|
|
25
|
+
|
|
26
|
+
const myYear = (screen.getByTestId(':date-time-input:control-year') as HTMLInputElement);
|
|
27
|
+
expect(myYear.value).toContain('2023');
|
|
28
|
+
expect(myYear).toHaveAttribute('placeholder', 'YYYY');
|
|
29
|
+
|
|
30
|
+
const myHour = (screen.getByTestId(':date-time-input:control-hour') as HTMLInputElement);
|
|
31
|
+
expect(myHour.value).toContain('04');
|
|
32
|
+
expect(myHour).toHaveAttribute('placeholder', 'hh');
|
|
33
|
+
|
|
34
|
+
const myMinute = (screen.getByTestId(':date-time-input:control-minute') as HTMLInputElement);
|
|
35
|
+
expect(myMinute.value).toContain('45');
|
|
36
|
+
expect(myMinute).toHaveAttribute('placeholder', 'mm');
|
|
37
|
+
|
|
38
|
+
const myPeriod = (screen.getByTestId(':date-time-input:control-period') as HTMLSelectElement).value;
|
|
39
|
+
expect(myPeriod).toContain('PM');
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
// press clear button
|
|
43
|
+
const clearX = screen.getByTestId(':date-time-input:clear-current-date-and-time') as HTMLButtonElement;
|
|
44
|
+
fireEvent.click(clearX);
|
|
45
|
+
|
|
46
|
+
const myClearMonth = (screen.getByTestId(':date-time-input:control-month') as HTMLInputElement).value;
|
|
47
|
+
expect(myClearMonth).toContain('');
|
|
48
|
+
|
|
49
|
+
const myClearDay = (screen.getByTestId(':date-time-input:control-day') as HTMLInputElement).value;
|
|
50
|
+
expect(myClearDay).toContain('');
|
|
51
|
+
|
|
52
|
+
const myClearYear = (screen.getByTestId(':date-time-input:control-year') as HTMLInputElement).value;
|
|
53
|
+
expect(myClearYear).toContain('');
|
|
54
|
+
|
|
55
|
+
const myClearHour = (screen.getByTestId(':date-time-input:control-hour') as HTMLInputElement).value;
|
|
56
|
+
expect(myClearHour).toContain('');
|
|
57
|
+
|
|
58
|
+
const myClearMinute = (screen.getByTestId(':date-time-input:control-minute') as HTMLInputElement).value;
|
|
59
|
+
expect(myClearMinute).toContain('');
|
|
60
|
+
|
|
61
|
+
const myClearPeriod = (screen.getByTestId(':date-time-input:control-period') as HTMLSelectElement).value;
|
|
62
|
+
expect(myClearPeriod).toContain('AM');
|
|
63
|
+
|
|
64
|
+
// press date picker
|
|
65
|
+
const pickerButton = screen.getByTestId(':date-time-input:open-close-picker') as HTMLButtonElement;
|
|
66
|
+
fireEvent.click(pickerButton);
|
|
67
|
+
|
|
68
|
+
// because need to wait after button pressed before finding the data picker pop up, need to do this
|
|
69
|
+
// via "await" and "findByTestId" (as opposed to getByTestId)
|
|
70
|
+
const dataPickerPopUp = await screen.findByTestId(':date-time-input:picker:date-picker:');
|
|
71
|
+
expect(dataPickerPopUp).not.toBeNull();
|
|
72
|
+
});
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDecimal/config.json
CHANGED
|
@@ -17,6 +17,31 @@
|
|
|
17
17
|
"format": "TEXT",
|
|
18
18
|
"required": true
|
|
19
19
|
},
|
|
20
|
+
{
|
|
21
|
+
"name": "labelOption",
|
|
22
|
+
"label": "Field label",
|
|
23
|
+
"format": "SELECT",
|
|
24
|
+
"defaultValue": "custom",
|
|
25
|
+
"visibility": "@PLATFORMNAME != 'launchpad'",
|
|
26
|
+
"source": [
|
|
27
|
+
{
|
|
28
|
+
"key": "default",
|
|
29
|
+
"value": "Default"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"key": "custom",
|
|
33
|
+
"value": "Custom"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "label",
|
|
39
|
+
"label": "Custom field label",
|
|
40
|
+
"format": "VALUEINPUT",
|
|
41
|
+
"required": true,
|
|
42
|
+
"ruleType": "Paragraph",
|
|
43
|
+
"visibility": "@PLATFORMNAME != 'launchpad'"
|
|
44
|
+
},
|
|
20
45
|
{
|
|
21
46
|
"name": "readOnly",
|
|
22
47
|
"label": "Edit mode",
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDecimal/demo.test.tsx
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// import { expect, test } from '@jest/globals';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { composeStories } from '@storybook/react';
|
|
4
|
+
import '@testing-library/jest-dom';
|
|
5
|
+
|
|
6
|
+
import * as DemoStories from './demo.stories';
|
|
7
|
+
|
|
8
|
+
const { BasePegaDxilMyDecimal } = composeStories(DemoStories);
|
|
9
|
+
|
|
10
|
+
test('renders PegaDxilMyDecimal', async () => {
|
|
11
|
+
render(<BasePegaDxilMyDecimal />);
|
|
12
|
+
expect(await screen.findByText('Decimal Sample')).toBeVisible();
|
|
13
|
+
expect(await screen.findByText('Decimal Helper Text')).toBeVisible();
|
|
14
|
+
|
|
15
|
+
const decimalElement = screen.getByRole('textbox');
|
|
16
|
+
|
|
17
|
+
const myTextAreaVal = (screen.getByRole('textbox') as HTMLInputElement).value;
|
|
18
|
+
expect(myTextAreaVal).toContain('');
|
|
19
|
+
|
|
20
|
+
expect(decimalElement).toHaveAttribute('placeholder', 'Decimal Placeholder');
|
|
21
|
+
});
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx
CHANGED
|
@@ -21,15 +21,16 @@ export default meta;
|
|
|
21
21
|
type Story = StoryObj<typeof PegaDxilMyDetails>;
|
|
22
22
|
|
|
23
23
|
if (!window.PCore) {
|
|
24
|
-
window.PCore = {};
|
|
24
|
+
window.PCore = {} as any;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
|
|
27
28
|
window.PCore.getLocaleUtils = () => {
|
|
28
29
|
return {
|
|
29
30
|
getLocaleValue: (value: any) => {
|
|
30
31
|
return value;
|
|
31
32
|
}
|
|
32
|
-
};
|
|
33
|
+
} as any;
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
window.PCore.getUserApi = () => {
|
|
@@ -39,7 +40,7 @@ window.PCore.getUserApi = () => {
|
|
|
39
40
|
resolve(operatorDetails);
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
|
-
};
|
|
43
|
+
} as any;
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
const Region = (props: any) => {
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.test.tsx
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// import { expect, test } from '@jest/globals';
|
|
2
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
3
|
+
import { composeStories } from '@storybook/react';
|
|
4
|
+
import '@testing-library/jest-dom';
|
|
5
|
+
|
|
6
|
+
import * as DemoStories from './demo.stories';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const { BasePegaDxilMyDetails } = composeStories(DemoStories);
|
|
11
|
+
|
|
12
|
+
test('renders PegaDxilMyDetails', async () => {
|
|
13
|
+
render(<BasePegaDxilMyDetails />);
|
|
14
|
+
expect(await screen.findByText('Details template')).toBeVisible();
|
|
15
|
+
expect(await screen.findByText('Work Status')).toBeVisible();
|
|
16
|
+
expect(await screen.findByText('Case ID')).toBeVisible();
|
|
17
|
+
expect(await screen.findByText('Create date/time')).toBeVisible();
|
|
18
|
+
expect(await screen.findByText('Create Operator')).toBeVisible();
|
|
19
|
+
|
|
20
|
+
// expect(await screen.findByText('New')).toBeVisible();
|
|
21
|
+
|
|
22
|
+
expect(await screen.findByText('M-1002')).toBeVisible();
|
|
23
|
+
expect(await screen.findByText('December 11, 2022 at 8:06:27 PM')).toBeVisible();
|
|
24
|
+
|
|
25
|
+
expect(await screen.findByText('SLA Deadline')).toBeVisible();
|
|
26
|
+
expect(await screen.findByText('SLA Goal')).toBeVisible();
|
|
27
|
+
expect(await screen.findByText('SLA Start Time')).toBeVisible();
|
|
28
|
+
|
|
29
|
+
expect(await screen.findByText('Deadline')).toBeVisible();
|
|
30
|
+
expect(await screen.findByText('Goal')).toBeVisible();
|
|
31
|
+
expect(await screen.findByText('Start Time')).toBeVisible();
|
|
32
|
+
|
|
33
|
+
const frenchBefore = screen.queryByText('french DigV2');
|
|
34
|
+
expect(frenchBefore).not.toBeInTheDocument();
|
|
35
|
+
|
|
36
|
+
// admin button
|
|
37
|
+
const adminButton = screen.getByRole('button');
|
|
38
|
+
fireEvent.click(adminButton);
|
|
39
|
+
|
|
40
|
+
const frenchArr = await screen.findAllByText('french DigV2');
|
|
41
|
+
expect(frenchArr[0]).toBeVisible();
|
|
42
|
+
expect(frenchArr[1]).toBeVisible();
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
});
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyEmail/config.json
CHANGED
|
@@ -17,6 +17,31 @@
|
|
|
17
17
|
"format": "TEXT",
|
|
18
18
|
"required": true
|
|
19
19
|
},
|
|
20
|
+
{
|
|
21
|
+
"name": "labelOption",
|
|
22
|
+
"label": "Field label",
|
|
23
|
+
"format": "SELECT",
|
|
24
|
+
"defaultValue": "custom",
|
|
25
|
+
"visibility": "@PLATFORMNAME != 'launchpad'",
|
|
26
|
+
"source": [
|
|
27
|
+
{
|
|
28
|
+
"key": "default",
|
|
29
|
+
"value": "Default"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"key": "custom",
|
|
33
|
+
"value": "Custom"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "label",
|
|
39
|
+
"label": "Custom field label",
|
|
40
|
+
"format": "VALUEINPUT",
|
|
41
|
+
"required": true,
|
|
42
|
+
"ruleType": "Paragraph",
|
|
43
|
+
"visibility": "@PLATFORMNAME != 'launchpad'"
|
|
44
|
+
},
|
|
20
45
|
{
|
|
21
46
|
"name": "readOnly",
|
|
22
47
|
"label": "Edit mode",
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyEmail/demo.test.tsx
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// import { expect, test } from '@jest/globals';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { composeStories } from '@storybook/react';
|
|
4
|
+
import '@testing-library/jest-dom';
|
|
5
|
+
|
|
6
|
+
import * as DemoStories from './demo.stories';
|
|
7
|
+
|
|
8
|
+
const { BasePegaDxilMyEmail } = composeStories(DemoStories);
|
|
9
|
+
|
|
10
|
+
test('renders PegaDxilMyEmail', async () => {
|
|
11
|
+
render(<BasePegaDxilMyEmail />);
|
|
12
|
+
expect(await screen.findByText('Email Sample')).toBeVisible();
|
|
13
|
+
expect(await screen.findByText('Email Helper Text')).toBeVisible();
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
const emailElement = (screen.getByTestId('email-12345678') as HTMLInputElement);
|
|
17
|
+
expect(emailElement.value).toBe('');
|
|
18
|
+
|
|
19
|
+
expect(emailElement).toHaveAttribute('placeholder', 'Email Placeholder');
|
|
20
|
+
});
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyForm/demo.test.tsx
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// import { expect, test } from '@jest/globals';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { composeStories } from '@storybook/react';
|
|
4
|
+
import '@testing-library/jest-dom';
|
|
5
|
+
|
|
6
|
+
import * as DemoStories from './demo.stories';
|
|
7
|
+
|
|
8
|
+
const { BasePegaDxilMyForm } = composeStories(DemoStories);
|
|
9
|
+
|
|
10
|
+
test('renders PegaDxilMyForm', async () => {
|
|
11
|
+
render(<BasePegaDxilMyForm />);
|
|
12
|
+
expect(await screen.findByText('Form template')).toBeVisible();
|
|
13
|
+
|
|
14
|
+
// labels
|
|
15
|
+
expect(await screen.findByText('First Name')).toBeVisible();
|
|
16
|
+
expect(await screen.findByText('Middle Name')).toBeVisible();
|
|
17
|
+
expect(await screen.findByText('Last Name')).toBeVisible();
|
|
18
|
+
expect(await screen.findByText('Email')).toBeVisible();
|
|
19
|
+
expect(await screen.findByText('Phone Number')).toBeVisible();
|
|
20
|
+
expect(await screen.findByText('Service Date')).toBeVisible();
|
|
21
|
+
|
|
22
|
+
const inputElements = screen.getAllByTestId(':input:control');
|
|
23
|
+
expect((inputElements[0] as HTMLInputElement).value).toBe('John');
|
|
24
|
+
expect((inputElements[1] as HTMLInputElement).value).toBe('');
|
|
25
|
+
expect((inputElements[2] as HTMLInputElement).value).toBe('Doe');
|
|
26
|
+
expect((inputElements[3] as HTMLInputElement).value).toBe('John@doe.com');
|
|
27
|
+
|
|
28
|
+
const myPhone = (screen.getByTestId(':phone-input:control') as HTMLInputElement).value;
|
|
29
|
+
expect(myPhone).toContain('(639) 797-5093');
|
|
30
|
+
|
|
31
|
+
const myClearMonth = (screen.getByTestId(':date-input:control-month') as HTMLInputElement).value;
|
|
32
|
+
expect(myClearMonth).toContain('01');
|
|
33
|
+
|
|
34
|
+
const myClearDay = (screen.getByTestId(':date-input:control-day') as HTMLInputElement).value;
|
|
35
|
+
expect(myClearDay).toContain('25');
|
|
36
|
+
|
|
37
|
+
const myClearYear = (screen.getByTestId(':date-input:control-year') as HTMLInputElement).value;
|
|
38
|
+
expect(myClearYear).toContain('2023');
|
|
39
|
+
|
|
40
|
+
});
|
|
@@ -15,7 +15,7 @@ export default meta;
|
|
|
15
15
|
type Story = StoryObj<typeof PegaDxilMyIconButtonUrl>;
|
|
16
16
|
|
|
17
17
|
if (!window.PCore) {
|
|
18
|
-
window.PCore = {};
|
|
18
|
+
window.PCore = {} as any;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
const statelistData = {
|
|
@@ -49,7 +49,7 @@ export const BasePegaDxilMyIconButtonUrl: Story = (args: any) => {
|
|
|
49
49
|
resolve(statelistData);
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
};
|
|
52
|
+
} as any;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
const props = {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// import { expect, test } from '@jest/globals';
|
|
2
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
3
|
+
import { composeStories } from '@storybook/react';
|
|
4
|
+
import '@testing-library/jest-dom';
|
|
5
|
+
|
|
6
|
+
import * as DemoStories from './demo.stories';
|
|
7
|
+
|
|
8
|
+
const { BasePegaDxilMyIconButtonUrl } = composeStories(DemoStories);
|
|
9
|
+
|
|
10
|
+
test('renders PegaDxilMyIconButtonUrl', async () => {
|
|
11
|
+
render(<BasePegaDxilMyIconButtonUrl />);
|
|
12
|
+
expect(await screen.findByText('State list for USA')).toBeVisible();
|
|
13
|
+
|
|
14
|
+
expect(screen.queryByText('Massachusetts')).not.toBeInTheDocument();
|
|
15
|
+
expect(screen.queryByText('Rhode Island')).not.toBeInTheDocument();
|
|
16
|
+
expect(screen.queryByText('Connecticut')).not.toBeInTheDocument();
|
|
17
|
+
|
|
18
|
+
const iconButton = screen.getByRole('button');
|
|
19
|
+
fireEvent.click(iconButton);
|
|
20
|
+
|
|
21
|
+
expect(await screen.findByText('Massachusetts')).toBeVisible();
|
|
22
|
+
expect(await screen.findByText('Rhode Island')).toBeVisible();
|
|
23
|
+
expect(await screen.findByText('Connecticut')).toBeVisible();
|
|
24
|
+
|
|
25
|
+
const iconLink = screen.getByRole('link');
|
|
26
|
+
expect(iconLink).toHaveAttribute('href', 'about:blank');
|
|
27
|
+
});
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyInteger/config.json
CHANGED
|
@@ -16,6 +16,31 @@
|
|
|
16
16
|
"format": "TEXT",
|
|
17
17
|
"required": true
|
|
18
18
|
},
|
|
19
|
+
{
|
|
20
|
+
"name": "labelOption",
|
|
21
|
+
"label": "Field label",
|
|
22
|
+
"format": "SELECT",
|
|
23
|
+
"defaultValue": "custom",
|
|
24
|
+
"visibility": "@PLATFORMNAME != 'launchpad'",
|
|
25
|
+
"source": [
|
|
26
|
+
{
|
|
27
|
+
"key": "default",
|
|
28
|
+
"value": "Default"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"key": "custom",
|
|
32
|
+
"value": "Custom"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "label",
|
|
38
|
+
"label": "Custom field label",
|
|
39
|
+
"format": "VALUEINPUT",
|
|
40
|
+
"required": true,
|
|
41
|
+
"ruleType": "Paragraph",
|
|
42
|
+
"visibility": "@PLATFORMNAME != 'launchpad'"
|
|
43
|
+
},
|
|
19
44
|
{
|
|
20
45
|
"name": "readOnly",
|
|
21
46
|
"label": "Edit mode",
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyInteger/demo.test.tsx
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// import { expect, test } from '@jest/globals';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { composeStories } from '@storybook/react';
|
|
4
|
+
import '@testing-library/jest-dom';
|
|
5
|
+
|
|
6
|
+
import * as DemoStories from './demo.stories';
|
|
7
|
+
|
|
8
|
+
const { BasePegaDxilMyInteger } = composeStories(DemoStories);
|
|
9
|
+
|
|
10
|
+
test('renders PegaDxilMyInteger', async () => {
|
|
11
|
+
render(<BasePegaDxilMyInteger />);
|
|
12
|
+
expect(await screen.findByText('Integer Sample')).toBeVisible();
|
|
13
|
+
expect(await screen.findByText('Integer Helper Text')).toBeVisible();
|
|
14
|
+
|
|
15
|
+
const integerElement = (screen.getByTestId('integer-12345678') as HTMLInputElement);
|
|
16
|
+
expect(integerElement.value).toBe('');
|
|
17
|
+
|
|
18
|
+
});
|