@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/original/components/createAll/Launchpad/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
|
+
});
|
package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/demo.stories.tsx
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
import { AppAnnouncement as PegaAppAnnouncement } from '@pega/cosmos-react-work';
|
|
7
|
+
import { useRef } from 'react';
|
|
7
8
|
|
|
8
9
|
import PegaDxilMyPage from './index';
|
|
9
10
|
import { pyHome1Resolved, pyHome1Raw } from './mock';
|
|
@@ -19,7 +20,7 @@ type Story = StoryObj<typeof PegaDxilMyPage>;
|
|
|
19
20
|
|
|
20
21
|
export const BasePegaDxilMyPage: Story = (args: any) => {
|
|
21
22
|
if (!window.PCore) {
|
|
22
|
-
window.PCore = {};
|
|
23
|
+
window.PCore = {} as any;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
window.PCore.getLocaleUtils = () => {
|
|
@@ -27,11 +28,13 @@ export const BasePegaDxilMyPage: Story = (args: any) => {
|
|
|
27
28
|
getLocaleValue: (val: any) => {
|
|
28
29
|
return val;
|
|
29
30
|
}
|
|
30
|
-
};
|
|
31
|
+
} as any;
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
const configProps = pyHome1Resolved.children[0].children[0].config;
|
|
34
35
|
|
|
36
|
+
const myRef = useRef(null);
|
|
37
|
+
|
|
35
38
|
const props = {
|
|
36
39
|
useConfigurableLayout: false,
|
|
37
40
|
icon: pyHome1Raw.config.icon,
|
|
@@ -82,6 +85,7 @@ export const BasePegaDxilMyPage: Story = (args: any) => {
|
|
|
82
85
|
}
|
|
83
86
|
};
|
|
84
87
|
}}
|
|
88
|
+
ref={myRef}
|
|
85
89
|
/>
|
|
86
90
|
);
|
|
87
91
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { BasePegaDxilMyPage } = composeStories(DemoStories);
|
|
11
|
+
|
|
12
|
+
test('renders PegaDxilMyPage', async () => {
|
|
13
|
+
render(<BasePegaDxilMyPage />);
|
|
14
|
+
expect(await screen.findByText('Page Template')).toBeVisible();
|
|
15
|
+
expect(await screen.findByText('Announcements')).toBeVisible();
|
|
16
|
+
expect(await screen.findByText('Get next work')).toBeVisible();
|
|
17
|
+
expect(await screen.findByText("We've launched a brand new experience to accelerate your workflow. Check out the guides to help you get the most of Cosmos.")).toBeVisible();
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
});
|
|
@@ -15,7 +15,7 @@ export default meta;
|
|
|
15
15
|
type Story = StoryObj<typeof PegaDxilMyPageCaseWidget>;
|
|
16
16
|
|
|
17
17
|
if (!window.PCore) {
|
|
18
|
-
window.PCore = {};
|
|
18
|
+
window.PCore = {} as any;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
window.PCore.getLocaleUtils = () => {
|
|
@@ -23,17 +23,18 @@ window.PCore.getLocaleUtils = () => {
|
|
|
23
23
|
getLocaleValue: (value: any) => {
|
|
24
24
|
return value;
|
|
25
25
|
}
|
|
26
|
-
};
|
|
26
|
+
} as any;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
window.PCore.getUserApi = () => {
|
|
30
30
|
return {
|
|
31
31
|
getOperatorDetails: () => {
|
|
32
32
|
return new Promise(resolve => {
|
|
33
|
+
// @ts-ignore
|
|
33
34
|
resolve(operatorDetails);
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
|
-
};
|
|
37
|
+
} as any;
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
export const BasePegaDxilMyPageCaseWidget: Story = (args: any) => {
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { BasePegaDxilMyPageCaseWidget } = composeStories(DemoStories);
|
|
11
|
+
|
|
12
|
+
test('renders PegaDxilMyPageCaseWidget', async () => {
|
|
13
|
+
render(<BasePegaDxilMyPageCaseWidget />);
|
|
14
|
+
expect(await screen.findByText('Create operator')).toBeVisible();
|
|
15
|
+
expect(await screen.findByText('Created')).toBeVisible();
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
});
|
package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/demo.stories.tsx
CHANGED
|
@@ -16,7 +16,7 @@ export default meta;
|
|
|
16
16
|
type Story = StoryObj<typeof PegaDxilMyPageWidget>;
|
|
17
17
|
|
|
18
18
|
if (!window.PCore) {
|
|
19
|
-
window.PCore = {};
|
|
19
|
+
window.PCore = {} as any;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const worklistData = {
|
|
@@ -49,15 +49,17 @@ window.PCore.getDataApiUtils = () => {
|
|
|
49
49
|
return {
|
|
50
50
|
getData: () => {
|
|
51
51
|
return new Promise(resolve => {
|
|
52
|
+
// @ts-ignore
|
|
52
53
|
resolve(worklistData);
|
|
53
54
|
});
|
|
54
55
|
},
|
|
55
56
|
getDataAsync: () => {
|
|
56
57
|
return new Promise(resolve => {
|
|
58
|
+
// @ts-ignore
|
|
57
59
|
resolve(worklistData);
|
|
58
60
|
});
|
|
59
61
|
}
|
|
60
|
-
};
|
|
62
|
+
} as any;
|
|
61
63
|
};
|
|
62
64
|
|
|
63
65
|
|
package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/demo.test.tsx
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
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 { BasePegaDxilMyPageWidget } = composeStories(DemoStories);
|
|
11
|
+
|
|
12
|
+
test('renders PegaDxilMyPageWidget', async () => {
|
|
13
|
+
render(<BasePegaDxilMyPageWidget />);
|
|
14
|
+
expect(await screen.findByText('Announcements')).toBeVisible();
|
|
15
|
+
expect(await screen.findByText("See what's new")).toBeVisible();
|
|
16
|
+
expect(
|
|
17
|
+
await screen.findByText('Welcome to MediaCo Application for testing SDK frameworks.')
|
|
18
|
+
).toBeVisible();
|
|
19
|
+
|
|
20
|
+
const workListArr = screen.getAllByText('Work list');
|
|
21
|
+
expect(workListArr[0]).toBeVisible();
|
|
22
|
+
expect(workListArr[1]).toBeInTheDocument();
|
|
23
|
+
|
|
24
|
+
expect(await screen.findByText('Case type')).toBeVisible();
|
|
25
|
+
expect(await screen.findByText('Key')).toBeVisible();
|
|
26
|
+
expect(await screen.findByText('Status')).toBeVisible();
|
|
27
|
+
expect(await screen.findByText('Stage')).toBeVisible();
|
|
28
|
+
|
|
29
|
+
expect(await screen.findByText('A-8002')).toBeVisible();
|
|
30
|
+
expect(await screen.findByText('A-7001')).toBeVisible();
|
|
31
|
+
expect(await screen.findByText('A-9000')).toBeVisible();
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
});
|
package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyParagraph/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/original/components/createAll/Launchpad/Pega_DXIL_MyParagraph/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 { BasePegaDxilMyParagraph } = composeStories(DemoStories);
|
|
9
|
+
|
|
10
|
+
test('renders PegaDxilMyParagraph', async () => {
|
|
11
|
+
render(<BasePegaDxilMyParagraph />);
|
|
12
|
+
expect(await screen.findByText('Paragraph Sample')).toBeVisible();
|
|
13
|
+
expect(await screen.findByText('Paragraph Helper Text')).toBeVisible();
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
const paragraphElement = (screen.getByTestId('paragraph-12345678') as HTMLTextAreaElement);
|
|
17
|
+
expect(paragraphElement.value).toBe('');
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
expect(paragraphElement).toHaveAttribute('placeholder', 'Paragraph Placeholder');
|
|
21
|
+
});
|
package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPercentage/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/original/components/createAll/Launchpad/Pega_DXIL_MyPercentage/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 { BasePegaDxilMyPercentage } = composeStories(DemoStories);
|
|
9
|
+
|
|
10
|
+
test('renders PegaDxilMyPercentage', async () => {
|
|
11
|
+
render(<BasePegaDxilMyPercentage />);
|
|
12
|
+
expect(await screen.findByText('Percentage Sample')).toBeVisible();
|
|
13
|
+
expect(await screen.findByText('Percentage Helper Text')).toBeVisible();
|
|
14
|
+
|
|
15
|
+
const percentElement = (screen.getByTestId('percentage-12345678') as HTMLInputElement);
|
|
16
|
+
expect(percentElement.value).toContain('%');
|
|
17
|
+
|
|
18
|
+
});
|
|
@@ -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",
|
|
@@ -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 { BasePegaDxilMyPhone } = composeStories(DemoStories);
|
|
9
|
+
|
|
10
|
+
test('renders PegaDxilMyPhone', async () => {
|
|
11
|
+
render(<BasePegaDxilMyPhone />);
|
|
12
|
+
expect(await screen.findByText('Phone Sample')).toBeVisible();
|
|
13
|
+
expect(await screen.findByText('Phone Helper Text')).toBeVisible();
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
const phoneElement = (screen.getByTestId('phone-12345678') as HTMLInputElement);
|
|
17
|
+
expect(phoneElement.value).toBe('');
|
|
18
|
+
|
|
19
|
+
expect(phoneElement).toHaveAttribute('placeholder', 'Phone Placeholder');
|
|
20
|
+
|
|
21
|
+
const countryElement = (screen.getByTestId(":phone-input:country-code") as HTMLSelectElement);
|
|
22
|
+
expect(countryElement.value).toContain("+1");
|
|
23
|
+
});
|
package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/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/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/demo.test.tsx
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
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 { BasePegaDxilMyPicklist } = composeStories(DemoStories);
|
|
9
|
+
|
|
10
|
+
test('renders PegaDxilMyPicklist', async () => {
|
|
11
|
+
render(<BasePegaDxilMyPicklist />);
|
|
12
|
+
expect(await screen.findByText('Picklist Sample')).toBeVisible();
|
|
13
|
+
expect(await screen.findByText('Picklist Helper Text')).toBeVisible();
|
|
14
|
+
|
|
15
|
+
const picklistElement = (screen.getByTestId('picklist-12345678') as HTMLSelectElement);
|
|
16
|
+
expect(picklistElement).toHaveAttribute('label', 'Picklist Sample');
|
|
17
|
+
expect(picklistElement.value).toContain('');
|
|
18
|
+
|
|
19
|
+
fireEvent.click(picklistElement);
|
|
20
|
+
|
|
21
|
+
fireEvent.change(picklistElement, { target: { value: 'Option 1' } });
|
|
22
|
+
|
|
23
|
+
expect(picklistElement.value).toContain('Option 1');
|
|
24
|
+
|
|
25
|
+
});
|
package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/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/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/demo.test.tsx
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
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 { BasePegaDxilMyRadiobuttons } = composeStories(DemoStories);
|
|
9
|
+
|
|
10
|
+
test('renders PegaDxilMyRadiobuttons', async () => {
|
|
11
|
+
render(<BasePegaDxilMyRadiobuttons />);
|
|
12
|
+
expect(await screen.findByText('Picklist Sample')).toBeVisible();
|
|
13
|
+
expect(await screen.findByText('Picklist Helper Text')).toBeVisible();
|
|
14
|
+
|
|
15
|
+
const radioElement = (screen.getByTestId('picklist-12345678') as HTMLSelectElement);
|
|
16
|
+
expect(radioElement.value).toBeUndefined();
|
|
17
|
+
|
|
18
|
+
const optionRadios = screen.getAllByRole('radio');
|
|
19
|
+
const option1 = optionRadios[1] as HTMLInputElement;
|
|
20
|
+
const option2 = optionRadios[2] as HTMLInputElement;
|
|
21
|
+
|
|
22
|
+
fireEvent.click(option1);
|
|
23
|
+
expect(option1).toBeChecked();
|
|
24
|
+
|
|
25
|
+
fireEvent.click(option2);
|
|
26
|
+
expect(option2).toBeChecked();
|
|
27
|
+
expect(option1).not.toBeChecked();
|
|
28
|
+
|
|
29
|
+
});
|
package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/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/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/demo.test.tsx
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
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 { BasePegaDxilMySearchbox } = composeStories(DemoStories);
|
|
9
|
+
|
|
10
|
+
test('renders PegaDxilMySearchbox', async () => {
|
|
11
|
+
render(<BasePegaDxilMySearchbox />);
|
|
12
|
+
expect(await screen.findByText('Picklist Sample')).toBeVisible();
|
|
13
|
+
expect(await screen.findByText('Picklist Helper Text')).toBeVisible();
|
|
14
|
+
|
|
15
|
+
const searchboxElement = screen.getByTestId(
|
|
16
|
+
'picklist-12345678:combo-box:control'
|
|
17
|
+
) as HTMLInputElement;
|
|
18
|
+
// expect(searchboxElement).toHaveAttribute('role', 'searchbox');
|
|
19
|
+
expect(searchboxElement).toHaveAttribute('role', 'combobox');
|
|
20
|
+
expect(searchboxElement).toHaveAttribute('autocomplete', 'off');
|
|
21
|
+
expect(searchboxElement).toHaveAttribute('placeholder', 'Select...');
|
|
22
|
+
expect(searchboxElement.value).toContain('');
|
|
23
|
+
|
|
24
|
+
fireEvent.click(searchboxElement);
|
|
25
|
+
|
|
26
|
+
// because need to wait after button pressed before finding the data picker pop up, need to do this
|
|
27
|
+
// via "await" and "findByTestId" (as opposed to getByTestId)
|
|
28
|
+
const dataPickerPopUp = await screen.findByTestId(':menu:');
|
|
29
|
+
expect(dataPickerPopUp).not.toBeNull();
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { BasePegaDxilMyText } = composeStories(DemoStories);
|
|
9
|
+
|
|
10
|
+
test('renders PegaDxilMyText', async () => {
|
|
11
|
+
render(<BasePegaDxilMyText />);
|
|
12
|
+
expect(await screen.findByText('Text Sample')).toBeVisible();
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const textElement = (screen.getByTestId('Text-12345678:input:control') as HTMLInputElement);
|
|
16
|
+
expect(textElement.value).toBe('');
|
|
17
|
+
|
|
18
|
+
expect(textElement).toHaveAttribute('placeholder', 'Text Placeholder');
|
|
19
|
+
});
|
package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTextInput/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/original/components/createAll/Launchpad/Pega_DXIL_MyTextInput/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 { BasePegaDxilMyTextInput } = composeStories(DemoStories);
|
|
9
|
+
|
|
10
|
+
test('renders PegaDxilMyTextInput', async () => {
|
|
11
|
+
render(<BasePegaDxilMyTextInput />);
|
|
12
|
+
expect(await screen.findByText('TextInput Sample')).toBeVisible();
|
|
13
|
+
expect(await screen.findByText('TextInput Helper Text')).toBeVisible();
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
const textInputElement = (screen.getByTestId('TextInput-12345678') as HTMLInputElement);
|
|
17
|
+
expect(textInputElement.value).toBe('');
|
|
18
|
+
|
|
19
|
+
expect(textInputElement).toHaveAttribute('placeholder', 'TextInput Placeholder');
|
|
20
|
+
});
|
package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/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",
|