@npm_leadtech/legal-lib-components 7.89.3 → 7.89.5
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/dist/css/styles.css +16 -0
- package/dist/images/componentsSvg/CloseIcon.js +1 -1
- package/dist/images/componentsSvg/CloseIcon.tsx +1 -1
- package/dist/images/componentsSvg/Done24px.d.ts +6 -0
- package/dist/images/componentsSvg/Done24px.js +2 -0
- package/dist/images/componentsSvg/Done24px.tsx +2 -2
- package/dist/images/componentsSvg/NewRelease24p.d.ts +6 -0
- package/dist/images/componentsSvg/NewRelease24p.js +2 -0
- package/dist/images/componentsSvg/NewRelease24p.tsx +2 -3
- package/dist/images/componentsSvg/Time24px.d.ts +6 -0
- package/dist/images/componentsSvg/Time24px.js +2 -0
- package/dist/images/componentsSvg/Time24px.tsx +2 -3
- package/dist/src/components/atoms/Button/Button.js +1 -1
- package/dist/src/components/atoms/Button/Button.scss +19 -0
- package/dist/src/components/atoms/Button/Button.tsx +1 -1
- package/dist/src/components/atoms/Button/ButtonProps.types.d.ts +1 -1
- package/dist/src/components/atoms/Button/ButtonProps.types.ts +1 -0
- package/dist/src/components/atoms/DocumentStatus/DocumentStatus.styled.js +2 -1
- package/dist/src/components/atoms/DocumentStatus/DocumentStatus.styled.ts +2 -1
- package/dist/src/components/atoms/DocumentStatus/DocumentStatusProps.types.d.ts +1 -1
- package/dist/src/components/atoms/DocumentStatus/DocumentStatusProps.types.ts +1 -1
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItem.d.ts +3 -0
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItem.js +16 -0
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItem.styled.d.ts +1 -0
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItem.styled.js +60 -0
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItem.styled.ts +61 -0
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItem.tsx +28 -0
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItemProps.types.d.ts +6 -0
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItemProps.types.js +1 -0
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItemProps.types.ts +7 -0
- package/dist/src/components/atoms/SignerStatusItem/index.d.ts +2 -0
- package/dist/src/components/atoms/SignerStatusItem/index.js +1 -0
- package/dist/src/components/atoms/SignerStatusItem/index.ts +2 -0
- package/dist/src/components/atoms/Tooltip/Tooltip.js +0 -2
- package/dist/src/components/atoms/Tooltip/Tooltip.tsx +0 -2
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContent.d.ts +3 -0
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContent.js +7 -0
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContent.styled.d.ts +1 -0
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContent.styled.js +22 -0
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContent.styled.ts +23 -0
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContent.tsx +38 -0
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContentProps.types.d.ts +9 -0
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContentProps.types.js +1 -0
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContentProps.types.ts +10 -0
- package/dist/src/components/molecules/SignersStatusTooltipContent/index.d.ts +2 -0
- package/dist/src/components/molecules/SignersStatusTooltipContent/index.js +1 -0
- package/dist/src/components/molecules/SignersStatusTooltipContent/index.ts +2 -0
- package/dist/src/components/molecules/TextInput/tests/Input.test.tsx +29 -18
- package/dist/src/components/molecules/TextInput/tests/TextInput.test.tsx +16 -9
- package/dist/src/components/molecules/TextInput/tests/TextInputMessage.test.tsx +2 -2
- package/dist/src/components/molecules/TextInput/tests/TextInputTooltip.test.tsx +1 -1
- package/dist/src/components/molecules/index.d.ts +1 -0
- package/dist/src/components/molecules/index.js +1 -0
- package/dist/src/components/molecules/index.ts +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { cleanup, fireEvent, render, waitFor } from '@testing-library/react'
|
|
2
|
-
import React from 'react'
|
|
1
|
+
import React, { cleanup, fireEvent, render, waitFor } from '@testing-library/react'
|
|
3
2
|
|
|
4
3
|
import { Input } from '../Input'
|
|
5
4
|
|
|
@@ -8,38 +7,50 @@ afterEach(cleanup)
|
|
|
8
7
|
const testName = 'name'
|
|
9
8
|
const testValue = 'value'
|
|
10
9
|
|
|
10
|
+
const defaultInputProps = {
|
|
11
|
+
name: '',
|
|
12
|
+
placeholder: '',
|
|
13
|
+
prefix: '',
|
|
14
|
+
value: '',
|
|
15
|
+
type: 'text' as const,
|
|
16
|
+
disabled: false,
|
|
17
|
+
className: '',
|
|
18
|
+
onChange: jest.fn(),
|
|
19
|
+
onClick: jest.fn(),
|
|
20
|
+
onBlur: jest.fn(),
|
|
21
|
+
onKeyDown: jest.fn(),
|
|
22
|
+
onKeyUp: jest.fn(),
|
|
23
|
+
country: ''
|
|
24
|
+
}
|
|
25
|
+
|
|
11
26
|
describe('will return the component', () => {
|
|
12
27
|
test('without props', () => {
|
|
13
|
-
const { getByRole } = render(<Input />)
|
|
28
|
+
const { getByRole } = render(<Input {...defaultInputProps} />)
|
|
14
29
|
expect(getByRole('textbox')).toBeInTheDocument()
|
|
15
30
|
expect(getByRole('textbox')).toHaveAttribute('type', 'text')
|
|
16
31
|
})
|
|
17
32
|
test('of type password: with the eyeIcon rendered', async () => {
|
|
18
|
-
const { container
|
|
33
|
+
const { container } = render(<Input {...defaultInputProps} type='password' value={testValue} />)
|
|
19
34
|
expect(container.firstChild).toHaveAttribute('type', 'password')
|
|
20
35
|
|
|
21
|
-
const
|
|
22
|
-
expect(
|
|
23
|
-
fireEvent.click(
|
|
36
|
+
const toggleButton = container.querySelector('.input-icon-password-button')
|
|
37
|
+
expect(toggleButton).toBeTruthy()
|
|
38
|
+
if (toggleButton) fireEvent.click(toggleButton)
|
|
24
39
|
|
|
25
40
|
await waitFor(() => {
|
|
26
41
|
expect(container.firstChild).toHaveAttribute('type', 'text')
|
|
27
42
|
})
|
|
28
43
|
})
|
|
29
|
-
test('of type password: with the eyeIcon rendered but
|
|
30
|
-
const { container
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const img = getByRole('img')
|
|
34
|
-
expect(img).toHaveClass('input-icon-password')
|
|
35
|
-
fireEvent.click(img)
|
|
44
|
+
test('of type password: with the eyeIcon rendered but without value shows password type initially', () => {
|
|
45
|
+
const { container } = render(<Input {...defaultInputProps} type='password' />)
|
|
46
|
+
const input = container.querySelector('input')
|
|
47
|
+
expect(input).toHaveAttribute('type', 'password')
|
|
36
48
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
})
|
|
49
|
+
const toggleButton = container.querySelector('.input-icon-password-button')
|
|
50
|
+
expect(toggleButton).toBeTruthy()
|
|
40
51
|
})
|
|
41
52
|
test('of type password: with the eyeIcon rendered', () => {
|
|
42
|
-
const { container } = render(<Input name={testName} />)
|
|
53
|
+
const { container } = render(<Input {...defaultInputProps} name={testName} />)
|
|
43
54
|
expect(container.firstChild).toHaveAttribute('data-qa', testName)
|
|
44
55
|
})
|
|
45
56
|
})
|
|
@@ -11,43 +11,50 @@ const testErrorMessage = 'Error message'
|
|
|
11
11
|
const testLabel = 'Label'
|
|
12
12
|
const testNotes = 'Notes'
|
|
13
13
|
|
|
14
|
+
const defaultTextInputProps = {
|
|
15
|
+
onChange: (): void => {},
|
|
16
|
+
country: ''
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
describe('will return the component', () => {
|
|
15
20
|
test('without props', () => {
|
|
16
|
-
const { getByRole, container } = render(<TextInput />)
|
|
21
|
+
const { getByRole, container } = render(<TextInput {...defaultTextInputProps} />)
|
|
17
22
|
expect(container.firstChild).toHaveClass('e-text')
|
|
18
23
|
expect(getByRole('textbox')).toHaveAttribute('type', 'text')
|
|
19
24
|
})
|
|
20
25
|
|
|
21
26
|
test('NumberFormat input if the format prop is passed', () => {
|
|
22
|
-
const { getByRole } = render(<TextInput format={testFormat} />)
|
|
27
|
+
const { getByRole } = render(<TextInput {...defaultTextInputProps} format={testFormat} />)
|
|
23
28
|
expect(getByRole('textbox')).toHaveClass('e-text-input')
|
|
24
29
|
expect(getByRole('textbox')).toHaveAttribute('type', 'text')
|
|
25
30
|
expect(getByRole('textbox')).toHaveAttribute('inputmode', 'numeric')
|
|
26
31
|
})
|
|
27
32
|
|
|
28
33
|
test('with a tooltip', () => {
|
|
29
|
-
const { getByText } = render(<TextInput tooltip={testTooltip} />)
|
|
34
|
+
const { getByText } = render(<TextInput {...defaultTextInputProps} tooltip={testTooltip} />)
|
|
30
35
|
expect(getByText(testTooltip)).toHaveClass('tooltip-form')
|
|
31
36
|
})
|
|
32
37
|
|
|
33
38
|
test('with a error message', () => {
|
|
34
|
-
const { getByText } = render(
|
|
39
|
+
const { getByText } = render(
|
|
40
|
+
<TextInput {...defaultTextInputProps} errorMessage={testErrorMessage} validate={false} />
|
|
41
|
+
)
|
|
35
42
|
expect(getByText(testErrorMessage)).toHaveClass('e-text__error-label')
|
|
36
43
|
})
|
|
37
44
|
|
|
38
45
|
test('with a label', () => {
|
|
39
|
-
const { getByText } = render(<TextInput label={testLabel} />)
|
|
46
|
+
const { getByText } = render(<TextInput {...defaultTextInputProps} label={testLabel} />)
|
|
40
47
|
expect(getByText(testLabel)).toHaveClass('form-group__label')
|
|
41
48
|
})
|
|
42
49
|
|
|
43
50
|
test('with notes', () => {
|
|
44
|
-
const { getByText } = render(<TextInput notes={testNotes} />)
|
|
51
|
+
const { getByText } = render(<TextInput {...defaultTextInputProps} notes={testNotes} />)
|
|
45
52
|
expect(getByText(testNotes)).toHaveClass('e-text__inner__notes')
|
|
46
53
|
})
|
|
47
54
|
|
|
48
55
|
test('should have children', () => {
|
|
49
56
|
const { getByText } = render(
|
|
50
|
-
<TextInput>
|
|
57
|
+
<TextInput {...defaultTextInputProps}>
|
|
51
58
|
<span>test children</span>
|
|
52
59
|
</TextInput>
|
|
53
60
|
)
|
|
@@ -55,10 +62,10 @@ describe('will return the component', () => {
|
|
|
55
62
|
})
|
|
56
63
|
|
|
57
64
|
test('should have id in input and for in label', () => {
|
|
58
|
-
const { getByText, getByLabelText } = render(<TextInput name='cvv' label='CVV' />)
|
|
65
|
+
const { getByText, getByLabelText } = render(<TextInput {...defaultTextInputProps} name='cvv' label='CVV' />)
|
|
59
66
|
|
|
60
67
|
const label = getByText('CVV')
|
|
61
|
-
const input = getByLabelText('CVV')
|
|
68
|
+
const input = getByLabelText('CVV') as HTMLInputElement
|
|
62
69
|
|
|
63
70
|
expect(label).toBeDefined()
|
|
64
71
|
expect(label).toHaveAttribute('for', 'cvv')
|
|
@@ -9,11 +9,11 @@ const testErrorMessage = 'Error message'
|
|
|
9
9
|
|
|
10
10
|
describe('will return null', () => {
|
|
11
11
|
test('if no prop is passed', () => {
|
|
12
|
-
const { container } = render(<TextInputMessage />)
|
|
12
|
+
const { container } = render(<TextInputMessage errorMessage='' validate={false} />)
|
|
13
13
|
expect(container.firstChild).toBe(null)
|
|
14
14
|
})
|
|
15
15
|
test('if errorMessage is passed and validate is true', () => {
|
|
16
|
-
const { container } = render(<TextInputMessage errorMessage={testErrorMessage} />)
|
|
16
|
+
const { container } = render(<TextInputMessage errorMessage={testErrorMessage} validate={true} />)
|
|
17
17
|
expect(container.firstChild).toBe(null)
|
|
18
18
|
})
|
|
19
19
|
})
|
|
@@ -9,7 +9,7 @@ const testTooltip = 'Tooltip'
|
|
|
9
9
|
|
|
10
10
|
describe('will return null', () => {
|
|
11
11
|
test('if no prop is passed', () => {
|
|
12
|
-
const { container } = render(<TextInputTooltip />)
|
|
12
|
+
const { container } = render(<TextInputTooltip tooltip='' />)
|
|
13
13
|
expect(container.firstChild).toBe(null)
|
|
14
14
|
})
|
|
15
15
|
})
|
|
@@ -43,6 +43,7 @@ export * from './RatafiaResultCardList';
|
|
|
43
43
|
export * from './RatafiaResultTabList';
|
|
44
44
|
export * from './SocialLinks';
|
|
45
45
|
export * from './SubscriptionCard';
|
|
46
|
+
export * from './SignersStatusTooltipContent';
|
|
46
47
|
export * from './Snackbar';
|
|
47
48
|
export * from './SearchBar';
|
|
48
49
|
export * from './StepGetForm';
|
|
@@ -43,6 +43,7 @@ export * from './RatafiaResultCardList';
|
|
|
43
43
|
export * from './RatafiaResultTabList';
|
|
44
44
|
export * from './SocialLinks';
|
|
45
45
|
export * from './SubscriptionCard';
|
|
46
|
+
export * from './SignersStatusTooltipContent';
|
|
46
47
|
export * from './Snackbar';
|
|
47
48
|
export * from './SearchBar';
|
|
48
49
|
export * from './StepGetForm';
|
|
@@ -43,6 +43,7 @@ export * from './RatafiaResultCardList'
|
|
|
43
43
|
export * from './RatafiaResultTabList'
|
|
44
44
|
export * from './SocialLinks'
|
|
45
45
|
export * from './SubscriptionCard'
|
|
46
|
+
export * from './SignersStatusTooltipContent'
|
|
46
47
|
export * from './Snackbar'
|
|
47
48
|
export * from './SearchBar'
|
|
48
49
|
export * from './StepGetForm'
|