@npm_leadtech/legal-lib-components 7.106.2 → 7.106.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/images/BenefitsCheckout/benefits-ai.svg +3 -0
- package/dist/images/BenefitsCheckout/benefits-check.svg +3 -0
- package/dist/images/CheckoutSummary/checkout-summary-document-56586a.png +0 -0
- package/dist/images/SocialProofBar/social-proof-avatar-01-avatar-1.png +0 -0
- package/dist/images/SocialProofBar/social-proof-avatar-02-avatar-2.png +0 -0
- package/dist/images/SocialProofBar/social-proof-avatar-03-avatar-3.png +0 -0
- package/dist/images/SocialProofBar/social-proof-avatar-04-avatar-4.png +0 -0
- package/dist/images/SocialProofBar/social-proof-avatar-05-avatar-5.png +0 -0
- package/dist/images/SocialProofBar/social-proof-star.svg +3 -0
- package/dist/images/componentsSvg/LockOutlineIcon.d.ts +7 -0
- package/dist/images/componentsSvg/LockOutlineIcon.js +2 -0
- package/dist/images/componentsSvg/LockOutlineIcon.tsx +19 -0
- package/dist/images/componentsSvg/__tests__/ArrowRight.test.tsx +25 -0
- package/dist/images/componentsSvg/__tests__/Balance.test.tsx +24 -0
- package/dist/images/componentsSvg/__tests__/ChevronExpandLess.test.tsx +18 -0
- package/dist/images/componentsSvg/__tests__/ChevronExpandMore.test.tsx +23 -0
- package/dist/images/componentsSvg/__tests__/ChevronRight.test.tsx +18 -0
- package/dist/images/componentsSvg/__tests__/ChevronRight24px.test.tsx +26 -0
- package/dist/images/componentsSvg/__tests__/CloseIcon.test.tsx +23 -0
- package/dist/images/componentsSvg/__tests__/Delete24p.test.tsx +25 -0
- package/dist/images/componentsSvg/__tests__/Done24px.test.tsx +24 -0
- package/dist/images/componentsSvg/__tests__/Done24pxoutlined.test.tsx +25 -0
- package/dist/images/componentsSvg/__tests__/Edit24p.test.tsx +25 -0
- package/dist/images/componentsSvg/__tests__/EditText24px.test.tsx +25 -0
- package/dist/images/componentsSvg/__tests__/EmploymentIcon.test.tsx +19 -0
- package/dist/images/componentsSvg/__tests__/Eye24pxOptimized.test.tsx +26 -0
- package/dist/images/componentsSvg/__tests__/GdprLockSvg.test.tsx +31 -0
- package/dist/images/componentsSvg/__tests__/IconDuplicate24px.test.tsx +25 -0
- package/dist/images/componentsSvg/__tests__/IconWeb.test.tsx +25 -0
- package/dist/images/componentsSvg/__tests__/InfoError24pxOutlined.test.tsx +28 -0
- package/dist/images/componentsSvg/__tests__/InfoLocationSvg.test.tsx +19 -0
- package/dist/images/componentsSvg/__tests__/InfoMailSvg.test.tsx +18 -0
- package/dist/images/componentsSvg/__tests__/InfoPhoneSvg.test.tsx +18 -0
- package/dist/images/componentsSvg/__tests__/LogoutSvg.test.tsx +25 -0
- package/dist/images/componentsSvg/__tests__/MailSvg.test.tsx +25 -0
- package/dist/images/componentsSvg/__tests__/MenuCollapse24p.test.tsx +28 -0
- package/dist/images/componentsSvg/__tests__/NewDocumentSvg.test.tsx +25 -0
- package/dist/images/componentsSvg/__tests__/NewRelease24p.test.tsx +24 -0
- package/dist/images/componentsSvg/__tests__/PhoneIcon.test.tsx +28 -0
- package/dist/images/componentsSvg/__tests__/PhoneIcon24px.test.tsx +29 -0
- package/dist/images/componentsSvg/__tests__/RatafiaIcon24px.test.tsx +24 -0
- package/dist/images/componentsSvg/__tests__/SearchIcon.test.tsx +25 -0
- package/dist/images/componentsSvg/__tests__/Sign24px.test.tsx +24 -0
- package/dist/images/componentsSvg/__tests__/SslShieldSvg.test.tsx +25 -0
- package/dist/images/componentsSvg/__tests__/SymbolDoc.test.tsx +28 -0
- package/dist/images/componentsSvg/__tests__/Time24px.test.tsx +24 -0
- package/dist/images/componentsSvg/flags/__tests__/CAFlag.test.tsx +26 -0
- package/dist/images/componentsSvg/flags/__tests__/DEFlag.test.tsx +30 -0
- package/dist/images/componentsSvg/flags/__tests__/GBFlag.test.tsx +28 -0
- package/dist/images/componentsSvg/flags/__tests__/USFlag.test.tsx +27 -0
- package/dist/images/componentsSvg/generalCategories/__tests__/BusinessIconCategory.test.tsx +25 -0
- package/dist/images/componentsSvg/generalCategories/__tests__/EmploymentIconCategory.test.tsx +24 -0
- package/dist/images/componentsSvg/generalCategories/__tests__/FinanceIconCategory.test.tsx +25 -0
- package/dist/images/componentsSvg/generalCategories/__tests__/PersonalFamilyIconCategory.test.tsx +26 -0
- package/dist/images/componentsSvg/generalCategories/__tests__/RealEstateIconCategory.test.tsx +25 -0
- package/dist/src/components/molecules/BenefitsCheckout/BenefitsCheckout.d.ts +3 -0
- package/dist/src/components/molecules/BenefitsCheckout/BenefitsCheckout.js +13 -0
- package/dist/src/components/molecules/BenefitsCheckout/BenefitsCheckout.styled.d.ts +1 -0
- package/dist/src/components/molecules/BenefitsCheckout/BenefitsCheckout.styled.js +56 -0
- package/dist/src/components/molecules/BenefitsCheckout/BenefitsCheckout.styled.ts +58 -0
- package/dist/src/components/molecules/BenefitsCheckout/BenefitsCheckout.tsx +34 -0
- package/dist/src/components/molecules/BenefitsCheckout/BenefitsCheckoutProps.types.d.ts +10 -0
- package/dist/src/components/molecules/BenefitsCheckout/BenefitsCheckoutProps.types.js +1 -0
- package/dist/src/components/molecules/BenefitsCheckout/BenefitsCheckoutProps.types.ts +12 -0
- package/dist/src/components/molecules/BenefitsCheckout/index.d.ts +2 -0
- package/dist/src/components/molecules/BenefitsCheckout/index.js +1 -0
- package/dist/src/components/molecules/BenefitsCheckout/index.ts +6 -0
- package/dist/src/components/molecules/CheckoutSummary/CheckoutSummary.d.ts +3 -0
- package/dist/src/components/molecules/CheckoutSummary/CheckoutSummary.js +24 -0
- package/dist/src/components/molecules/CheckoutSummary/CheckoutSummary.styled.d.ts +1 -0
- package/dist/src/components/molecules/CheckoutSummary/CheckoutSummary.styled.js +194 -0
- package/dist/src/components/molecules/CheckoutSummary/CheckoutSummary.styled.ts +198 -0
- package/dist/src/components/molecules/CheckoutSummary/CheckoutSummary.tsx +59 -0
- package/dist/src/components/molecules/CheckoutSummary/CheckoutSummaryProps.types.d.ts +10 -0
- package/dist/src/components/molecules/CheckoutSummary/CheckoutSummaryProps.types.js +1 -0
- package/dist/src/components/molecules/CheckoutSummary/CheckoutSummaryProps.types.ts +11 -0
- package/dist/src/components/molecules/CheckoutSummary/index.d.ts +2 -0
- package/dist/src/components/molecules/CheckoutSummary/index.js +1 -0
- package/dist/src/components/molecules/CheckoutSummary/index.ts +2 -0
- package/dist/src/components/molecules/SocialProofBar/SocialProofBar.d.ts +3 -0
- package/dist/src/components/molecules/SocialProofBar/SocialProofBar.js +11 -0
- package/dist/src/components/molecules/SocialProofBar/SocialProofBar.styled.d.ts +1 -0
- package/dist/src/components/molecules/SocialProofBar/SocialProofBar.styled.js +115 -0
- package/dist/src/components/molecules/SocialProofBar/SocialProofBar.styled.ts +117 -0
- package/dist/src/components/molecules/SocialProofBar/SocialProofBar.tsx +43 -0
- package/dist/src/components/molecules/SocialProofBar/SocialProofBarProps.types.d.ts +8 -0
- package/dist/src/components/molecules/SocialProofBar/SocialProofBarProps.types.js +1 -0
- package/dist/src/components/molecules/SocialProofBar/SocialProofBarProps.types.ts +8 -0
- package/dist/src/components/molecules/SocialProofBar/index.d.ts +2 -0
- package/dist/src/components/molecules/SocialProofBar/index.js +1 -0
- package/dist/src/components/molecules/SocialProofBar/index.ts +2 -0
- package/dist/src/components/molecules/index.d.ts +3 -0
- package/dist/src/components/molecules/index.js +3 -0
- package/dist/src/components/molecules/index.ts +3 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cleanup, render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { MenuCollapse24p } from '../MenuCollapse24p'
|
|
5
|
+
|
|
6
|
+
describe('MenuCollapse24p', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders the menu icon at 24px and includes its description', () => {
|
|
10
|
+
const { container } = render(<MenuCollapse24p />)
|
|
11
|
+
const svg = container.querySelector('svg')
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('width', '24px')
|
|
14
|
+
expect(svg).toHaveAttribute('height', '24px')
|
|
15
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 24 24')
|
|
16
|
+
expect(svg?.querySelector('title')).toHaveTextContent('735FFC4F-7DB9-4268-8987-12A1D38D3294')
|
|
17
|
+
expect(svg?.querySelector('desc')).toHaveTextContent('Created with sketchtool.')
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
test('forwards className and renders the neutral fill layer', () => {
|
|
21
|
+
const { container } = render(<MenuCollapse24p className='menu-more' />)
|
|
22
|
+
const svg = container.querySelector('svg')
|
|
23
|
+
|
|
24
|
+
expect(svg).toHaveClass('menu-more')
|
|
25
|
+
expect(svg?.querySelector('g[mask]')).toHaveAttribute('fill', '#6D7275')
|
|
26
|
+
expect(svg?.querySelector('mask use')).toBeInTheDocument()
|
|
27
|
+
})
|
|
28
|
+
})
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cleanup, render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { NewDocumentSvg } from '../NewDocumentSvg'
|
|
5
|
+
|
|
6
|
+
describe('NewDocumentSvg', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders a 24px document icon with its masked shape', () => {
|
|
10
|
+
const { container } = render(<NewDocumentSvg />)
|
|
11
|
+
const svg = container.querySelector('svg')
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('width', '24')
|
|
14
|
+
expect(svg).toHaveAttribute('height', '24')
|
|
15
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 24 24')
|
|
16
|
+
expect(svg?.querySelector('defs path')).toBeInTheDocument()
|
|
17
|
+
expect(svg?.querySelector('mask use')).toBeInTheDocument()
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
test('uses the light artwork fill', () => {
|
|
21
|
+
const { container } = render(<NewDocumentSvg />)
|
|
22
|
+
|
|
23
|
+
expect(container.querySelector('svg g[mask]')).toHaveAttribute('fill', '#F3F7FA')
|
|
24
|
+
})
|
|
25
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cleanup, render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { NewRelease24p } from '../NewRelease24p'
|
|
5
|
+
|
|
6
|
+
describe('NewRelease24p', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders the release information icon at 14px', () => {
|
|
10
|
+
const { container } = render(<NewRelease24p />)
|
|
11
|
+
const svg = container.querySelector('svg')
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('width', '14')
|
|
14
|
+
expect(svg).toHaveAttribute('height', '14')
|
|
15
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 14 14')
|
|
16
|
+
expect(svg?.querySelector('path')).toBeInTheDocument()
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('forwards a custom className', () => {
|
|
20
|
+
const { container } = render(<NewRelease24p className='release-indicator' />)
|
|
21
|
+
|
|
22
|
+
expect(container.querySelector('svg')).toHaveClass('release-indicator')
|
|
23
|
+
})
|
|
24
|
+
})
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cleanup, render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { PhoneIcon } from '../PhoneIcon'
|
|
5
|
+
|
|
6
|
+
describe('PhoneIcon', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('uses the default dimensions and fill', () => {
|
|
10
|
+
const { container } = render(<PhoneIcon />)
|
|
11
|
+
const svg = container.querySelector('svg')
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 24 24')
|
|
14
|
+
expect(svg).toHaveAttribute('width', '24')
|
|
15
|
+
expect(svg).toHaveAttribute('height', '24')
|
|
16
|
+
expect(svg).toHaveAttribute('fill', 'none')
|
|
17
|
+
expect(svg?.querySelector('#path')).toBeInTheDocument()
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
test('applies custom dimensions and fill', () => {
|
|
21
|
+
const { container } = render(<PhoneIcon width={32} height={28} fill='currentColor' />)
|
|
22
|
+
const svg = container.querySelector('svg')
|
|
23
|
+
|
|
24
|
+
expect(svg).toHaveAttribute('width', '32')
|
|
25
|
+
expect(svg).toHaveAttribute('height', '28')
|
|
26
|
+
expect(svg).toHaveAttribute('fill', 'currentColor')
|
|
27
|
+
})
|
|
28
|
+
})
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { cleanup, render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { PhoneIcon24px } from '../PhoneIcon24px'
|
|
5
|
+
|
|
6
|
+
describe('PhoneIcon24px', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders its default 24px viewport and black fill layer', () => {
|
|
10
|
+
const { container } = render(<PhoneIcon24px />)
|
|
11
|
+
const svg = container.querySelector('svg')
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('width', '24')
|
|
14
|
+
expect(svg).toHaveAttribute('height', '24')
|
|
15
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 24 24')
|
|
16
|
+
expect(svg?.querySelector('defs path')).toBeInTheDocument()
|
|
17
|
+
expect(svg?.querySelector('.icon-web-24-p')).toHaveAttribute('fill', '#000')
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
test('accepts custom dimensions, className, and fill', () => {
|
|
21
|
+
const { container } = render(<PhoneIcon24px width='32' height='18' fill='teal' className='phone-link' />)
|
|
22
|
+
const svg = container.querySelector('svg')
|
|
23
|
+
|
|
24
|
+
expect(svg).toHaveAttribute('width', '32')
|
|
25
|
+
expect(svg).toHaveAttribute('height', '18')
|
|
26
|
+
expect(svg).toHaveClass('phone-link')
|
|
27
|
+
expect(svg?.querySelector('.icon-web-24-p')).toHaveAttribute('fill', 'teal')
|
|
28
|
+
})
|
|
29
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cleanup, render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { RatafiaIcon24px } from '../RatafiaIcon24px'
|
|
5
|
+
|
|
6
|
+
describe('RatafiaIcon24px', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders the Ratafia icon in its 17 by 16 viewport', () => {
|
|
10
|
+
const { container } = render(<RatafiaIcon24px />)
|
|
11
|
+
const svg = container.querySelector('svg')
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('width', '17')
|
|
14
|
+
expect(svg).toHaveAttribute('height', '16')
|
|
15
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 17 16')
|
|
16
|
+
expect(svg?.querySelector('#Icon\\/Symbol\\/AI_24px path')).toHaveAttribute('fill', '#078080')
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('forwards a custom className', () => {
|
|
20
|
+
const { container } = render(<RatafiaIcon24px className='ratafia-mark' />)
|
|
21
|
+
|
|
22
|
+
expect(container.querySelector('svg')).toHaveClass('ratafia-mark')
|
|
23
|
+
})
|
|
24
|
+
})
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cleanup, render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { SearchIcon } from '../SearchIcon'
|
|
5
|
+
|
|
6
|
+
describe('SearchIcon', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders the search artwork with its title and path', () => {
|
|
10
|
+
const { container } = render(<SearchIcon />)
|
|
11
|
+
const svg = container.querySelector('svg')
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('width', '17px')
|
|
14
|
+
expect(svg).toHaveAttribute('height', '18px')
|
|
15
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 17 18')
|
|
16
|
+
expect(svg?.querySelector('title')).toHaveTextContent('icon/search_24px')
|
|
17
|
+
expect(svg?.querySelector('path')).toHaveAttribute('fill-rule', 'nonzero')
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
test('forwards an optional className to the svg', () => {
|
|
21
|
+
const { container } = render(<SearchIcon className='search-control' />)
|
|
22
|
+
|
|
23
|
+
expect(container.querySelector('svg')).toHaveClass('search-control')
|
|
24
|
+
})
|
|
25
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cleanup, render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { Sign24px } from '../Sign24px'
|
|
5
|
+
|
|
6
|
+
describe('Sign24px', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders the signature icon with its configured dimensions', () => {
|
|
10
|
+
const { container } = render(<Sign24px />)
|
|
11
|
+
const svg = container.querySelector('svg')
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('width', '17')
|
|
14
|
+
expect(svg).toHaveAttribute('height', '16')
|
|
15
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 24 24')
|
|
16
|
+
expect(svg?.querySelector('#path')).toHaveAttribute('fill', '#6D7275')
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('forwards a custom className', () => {
|
|
20
|
+
const { container } = render(<Sign24px className='signature-action' />)
|
|
21
|
+
|
|
22
|
+
expect(container.querySelector('svg')).toHaveClass('signature-action')
|
|
23
|
+
})
|
|
24
|
+
})
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cleanup, render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { SslShieldSvg } from '../SslShieldSvg'
|
|
5
|
+
|
|
6
|
+
describe('SslShieldSvg', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders the shield using its default fill', () => {
|
|
10
|
+
const { container } = render(<SslShieldSvg />)
|
|
11
|
+
const svg = container.querySelector('svg')
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('width', '20')
|
|
14
|
+
expect(svg).toHaveAttribute('height', '20')
|
|
15
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 20 20')
|
|
16
|
+
expect(svg?.querySelector('path')).toHaveAttribute('fill', 'white')
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('forwards className and custom shield fill', () => {
|
|
20
|
+
const { container } = render(<SslShieldSvg className='ssl-shield' fill='navy' />)
|
|
21
|
+
|
|
22
|
+
expect(container.querySelector('svg')).toHaveClass('ssl-shield')
|
|
23
|
+
expect(container.querySelector('svg path')).toHaveAttribute('fill', 'navy')
|
|
24
|
+
})
|
|
25
|
+
})
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cleanup, render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { SymbolDoc } from '../SymbolDoc'
|
|
5
|
+
|
|
6
|
+
describe('SymbolDoc', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders the document symbol in a 24px viewport', () => {
|
|
10
|
+
const { container } = render(<SymbolDoc />)
|
|
11
|
+
const svg = container.querySelector('svg')
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('width', '24')
|
|
14
|
+
expect(svg).toHaveAttribute('height', '24')
|
|
15
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 24 24')
|
|
16
|
+
expect(svg).toHaveAttribute('fill', '#1E2021')
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('renders the document outline with its expected fill rules', () => {
|
|
20
|
+
const { container } = render(<SymbolDoc />)
|
|
21
|
+
const path = container.querySelector('svg path')
|
|
22
|
+
|
|
23
|
+
expect(path).toBeInTheDocument()
|
|
24
|
+
expect(path).toHaveAttribute('fill-rule', 'evenodd')
|
|
25
|
+
expect(path).toHaveAttribute('clip-rule', 'evenodd')
|
|
26
|
+
expect(path).toHaveAttribute('fill', 'inherit')
|
|
27
|
+
})
|
|
28
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cleanup, render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { Time24px } from '../Time24px'
|
|
5
|
+
|
|
6
|
+
describe('Time24px', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders the clock icon with its default compact dimensions', () => {
|
|
10
|
+
const { container } = render(<Time24px />)
|
|
11
|
+
const svg = container.querySelector('svg')
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('width', '14')
|
|
14
|
+
expect(svg).toHaveAttribute('height', '14')
|
|
15
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 14 14')
|
|
16
|
+
expect(svg?.querySelector('path')).toHaveAttribute('fill-rule', 'evenodd')
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('forwards a custom className', () => {
|
|
20
|
+
const { container } = render(<Time24px className='time-indicator' />)
|
|
21
|
+
|
|
22
|
+
expect(container.querySelector('svg')).toHaveClass('time-indicator')
|
|
23
|
+
})
|
|
24
|
+
})
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cleanup, render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { CAFlag } from '../CAFlag'
|
|
5
|
+
|
|
6
|
+
describe('CAFlag', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders the Canadian flag at its expected dimensions', () => {
|
|
10
|
+
const { container } = render(<CAFlag />)
|
|
11
|
+
const svg = container.querySelector('svg')
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('width', '21')
|
|
14
|
+
expect(svg).toHaveAttribute('height', '16')
|
|
15
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 21 16')
|
|
16
|
+
expect(svg?.querySelector('clipPath')).toBeInTheDocument()
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('includes the red maple-leaf artwork and white center stripe', () => {
|
|
20
|
+
const { container } = render(<CAFlag />)
|
|
21
|
+
const paths = container.querySelectorAll('svg path')
|
|
22
|
+
|
|
23
|
+
expect(Array.from(paths).some((path) => path.getAttribute('fill') === '#D52B1E')).toBe(true)
|
|
24
|
+
expect(Array.from(paths).some((path) => path.getAttribute('fill') === 'white')).toBe(true)
|
|
25
|
+
})
|
|
26
|
+
})
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { cleanup, render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { DEFlag } from '../DEFlag'
|
|
5
|
+
|
|
6
|
+
describe('DEFlag', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders the German flag with its three horizontal stripe colors', () => {
|
|
10
|
+
const { container } = render(<DEFlag />)
|
|
11
|
+
const svg = container.querySelector('svg')
|
|
12
|
+
const stripes = svg?.querySelectorAll('path[id^="Vector"]')
|
|
13
|
+
|
|
14
|
+
expect(svg).toHaveAttribute('width', '21')
|
|
15
|
+
expect(svg).toHaveAttribute('height', '16')
|
|
16
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 21 16')
|
|
17
|
+
expect(stripes).toHaveLength(3)
|
|
18
|
+
expect(Array.from(stripes ?? []).map((path) => path.getAttribute('fill'))).toEqual([
|
|
19
|
+
'#FFCC00',
|
|
20
|
+
'#000001',
|
|
21
|
+
'#FF0000'
|
|
22
|
+
])
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
test('clips the artwork to the flag boundary', () => {
|
|
26
|
+
const { container } = render(<DEFlag />)
|
|
27
|
+
|
|
28
|
+
expect(container.querySelector('svg clipPath rect')).toHaveAttribute('rx', '2')
|
|
29
|
+
})
|
|
30
|
+
})
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cleanup, render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { GBFlag } from '../GBFlag'
|
|
5
|
+
|
|
6
|
+
describe('GBFlag', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders the flag at the shared flag dimensions', () => {
|
|
10
|
+
const { container } = render(<GBFlag />)
|
|
11
|
+
const svg = container.querySelector('svg')
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('width', '21')
|
|
14
|
+
expect(svg).toHaveAttribute('height', '16')
|
|
15
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 21 16')
|
|
16
|
+
expect(svg?.querySelector('clipPath')).toBeInTheDocument()
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('includes the blue field and red-and-white cross artwork', () => {
|
|
20
|
+
const { container } = render(<GBFlag />)
|
|
21
|
+
const svg = container.querySelector('svg')
|
|
22
|
+
|
|
23
|
+
expect(svg?.querySelector('rect[fill="#0A17A7"]')).toBeInTheDocument()
|
|
24
|
+
expect(svg?.querySelector('path[fill="#E6273E"]')).toBeInTheDocument()
|
|
25
|
+
expect(svg?.querySelector('path[fill="white"]')).toBeInTheDocument()
|
|
26
|
+
expect(svg?.querySelectorAll('path[stroke="#DB1F35"]')).toHaveLength(4)
|
|
27
|
+
})
|
|
28
|
+
})
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { cleanup, render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { USFlag } from '../USFlag'
|
|
5
|
+
|
|
6
|
+
describe('USFlag', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders the flag at the shared flag dimensions', () => {
|
|
10
|
+
const { container } = render(<USFlag />)
|
|
11
|
+
const svg = container.querySelector('svg')
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('width', '21')
|
|
14
|
+
expect(svg).toHaveAttribute('height', '16')
|
|
15
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 21 16')
|
|
16
|
+
expect(svg?.querySelector('g[clip-path]')).toBeInTheDocument()
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('renders the red and white stripes with the blue canton', () => {
|
|
20
|
+
const { container } = render(<USFlag />)
|
|
21
|
+
const svg = container.querySelector('svg')
|
|
22
|
+
|
|
23
|
+
expect(svg?.querySelector('path[fill="#B22234"]')).toBeInTheDocument()
|
|
24
|
+
expect(svg?.querySelector('path[fill="#192F5D"]')).toBeInTheDocument()
|
|
25
|
+
expect(svg?.querySelectorAll('path[fill="white"]').length).toBeGreaterThan(1)
|
|
26
|
+
})
|
|
27
|
+
})
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cleanup, render, screen } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { BusinessIconCategory } from '../BusinessIconCategory'
|
|
5
|
+
|
|
6
|
+
describe('BusinessIconCategory', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('exposes its title and default icon dimensions', () => {
|
|
10
|
+
const { container } = render(<BusinessIconCategory alt='Business' />)
|
|
11
|
+
const svg = screen.getByRole('img', { name: 'Business' })
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('width', '24')
|
|
14
|
+
expect(svg).toHaveAttribute('height', '24')
|
|
15
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 24 24')
|
|
16
|
+
expect(container.querySelector('#Icon\\/category\\/business_24px path')).toBeInTheDocument()
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('accepts custom width and height', () => {
|
|
20
|
+
render(<BusinessIconCategory alt='Business' width={32} height={18} />)
|
|
21
|
+
|
|
22
|
+
expect(screen.getByRole('img', { name: 'Business' })).toHaveAttribute('width', '32')
|
|
23
|
+
expect(screen.getByRole('img', { name: 'Business' })).toHaveAttribute('height', '18')
|
|
24
|
+
})
|
|
25
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cleanup, render, screen } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { EmploymentIconCategory } from '../EmploymentIconCategory'
|
|
5
|
+
|
|
6
|
+
describe('EmploymentIconCategory', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders an accessible employment icon with its path', () => {
|
|
10
|
+
const { container } = render(<EmploymentIconCategory alt='Employment' />)
|
|
11
|
+
const svg = screen.getByRole('img', { name: 'Employment' })
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 24 24')
|
|
14
|
+
expect(svg).toHaveAttribute('width', '24')
|
|
15
|
+
expect(svg).toHaveAttribute('height', '24')
|
|
16
|
+
expect(container.querySelector('#Icon\\/category\\/employment_24px path')).toBeInTheDocument()
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('uses the alt text as the SVG title', () => {
|
|
20
|
+
const { container } = render(<EmploymentIconCategory alt='Work and careers' />)
|
|
21
|
+
|
|
22
|
+
expect(container.querySelector('svg title')).toHaveTextContent('Work and careers')
|
|
23
|
+
})
|
|
24
|
+
})
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cleanup, render, screen } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { FinanceIconCategory } from '../FinanceIconCategory'
|
|
5
|
+
|
|
6
|
+
describe('FinanceIconCategory', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders an accessible finance icon with its category path', () => {
|
|
10
|
+
const { container } = render(<FinanceIconCategory alt='Finance' />)
|
|
11
|
+
const svg = screen.getByRole('img', { name: 'Finance' })
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 24 24')
|
|
14
|
+
expect(svg).toHaveAttribute('fill', '#1E2021')
|
|
15
|
+
expect(container.querySelector('#Icon\\/category\\/finance_24px path')).toBeInTheDocument()
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
test('supports non-square dimensions', () => {
|
|
19
|
+
render(<FinanceIconCategory alt='Finance' width={30} height={22} />)
|
|
20
|
+
const svg = screen.getByRole('img', { name: 'Finance' })
|
|
21
|
+
|
|
22
|
+
expect(svg).toHaveAttribute('width', '30')
|
|
23
|
+
expect(svg).toHaveAttribute('height', '22')
|
|
24
|
+
})
|
|
25
|
+
})
|
package/dist/images/componentsSvg/generalCategories/__tests__/PersonalFamilyIconCategory.test.tsx
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cleanup, render, screen } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { PersonalFamilyIconCategory } from '../PersonalFamilyIconCategory'
|
|
5
|
+
|
|
6
|
+
describe('PersonalFamilyIconCategory', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders an accessible family category icon', () => {
|
|
10
|
+
const { container } = render(<PersonalFamilyIconCategory alt='Personal and family' />)
|
|
11
|
+
const svg = screen.getByRole('img', { name: 'Personal and family' })
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 24 24')
|
|
14
|
+
expect(svg.querySelector('path')).toBeInTheDocument()
|
|
15
|
+
expect(svg.querySelector('path')).toHaveAttribute('fill-rule', 'evenodd')
|
|
16
|
+
expect(container.querySelector('title')).toHaveTextContent('Personal and family')
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('allows the icon dimensions to be overridden', () => {
|
|
20
|
+
render(<PersonalFamilyIconCategory alt='Family' width={40} height={36} />)
|
|
21
|
+
const svg = screen.getByRole('img', { name: 'Family' })
|
|
22
|
+
|
|
23
|
+
expect(svg).toHaveAttribute('width', '40')
|
|
24
|
+
expect(svg).toHaveAttribute('height', '36')
|
|
25
|
+
})
|
|
26
|
+
})
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cleanup, render, screen } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { RealEstateIconCategory } from '../RealEstateIconCategory'
|
|
5
|
+
|
|
6
|
+
describe('RealEstateIconCategory', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders a titled real-estate icon with the default size', () => {
|
|
10
|
+
const { container } = render(<RealEstateIconCategory alt='Real estate' />)
|
|
11
|
+
const svg = screen.getByRole('img', { name: 'Real estate' })
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('width', '24')
|
|
14
|
+
expect(svg).toHaveAttribute('height', '24')
|
|
15
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 24 24')
|
|
16
|
+
expect(container.querySelector('svg path')).toBeInTheDocument()
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('forwards custom dimensions', () => {
|
|
20
|
+
render(<RealEstateIconCategory alt='Property' width={48} height={24} />)
|
|
21
|
+
|
|
22
|
+
expect(screen.getByRole('img', { name: 'Property' })).toHaveAttribute('width', '48')
|
|
23
|
+
expect(screen.getByRole('img', { name: 'Property' })).toHaveAttribute('height', '24')
|
|
24
|
+
})
|
|
25
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from 'react';
|
|
3
|
+
import { BenefitsCheckoutStyled } from './BenefitsCheckout.styled';
|
|
4
|
+
import aiIcon from '../../../../images/BenefitsCheckout/benefits-ai.svg';
|
|
5
|
+
import checkIcon from '../../../../images/BenefitsCheckout/benefits-check.svg';
|
|
6
|
+
const iconByType = {
|
|
7
|
+
ai: aiIcon,
|
|
8
|
+
check: checkIcon
|
|
9
|
+
};
|
|
10
|
+
export const BenefitsCheckout = ({ title, benefits, className }) => {
|
|
11
|
+
const titleId = useId();
|
|
12
|
+
return (_jsxs(BenefitsCheckoutStyled, { className: ['benefits-checkout', className].filter(Boolean).join(' '), "aria-labelledby": titleId, children: [_jsx("h2", { className: 'benefits-checkout__title', id: titleId, children: title }), _jsx("ul", { className: 'benefits-checkout__list', children: benefits.map((benefit, index) => (_jsxs("li", { className: 'benefits-checkout__item', children: [_jsx("img", { src: iconByType[benefit.icon ?? 'check'], alt: '', "aria-hidden": 'true' }), _jsx("span", { children: benefit.text })] }, `${benefit.icon ?? 'check'}-${index}-${benefit.text}`))) })] }));
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BenefitsCheckoutStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>>> & string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { size } from '../../../globalStyles/breakpoints';
|
|
3
|
+
export const BenefitsCheckoutStyled = styled.section `
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
display: flex;
|
|
6
|
+
width: 100%;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: stretch;
|
|
9
|
+
gap: 0.625rem;
|
|
10
|
+
padding: 1.5rem;
|
|
11
|
+
border-radius: 1rem;
|
|
12
|
+
background: var(--neutral-neutral-6);
|
|
13
|
+
font-family: var(--font-main);
|
|
14
|
+
|
|
15
|
+
.benefits-checkout {
|
|
16
|
+
&__title {
|
|
17
|
+
margin: 0;
|
|
18
|
+
color: var(--neutral-neutral-2);
|
|
19
|
+
font-size: 0.875rem;
|
|
20
|
+
font-weight: 700;
|
|
21
|
+
line-height: 1.125rem;
|
|
22
|
+
letter-spacing: -0.0214em;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&__list {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
gap: 0.5rem;
|
|
29
|
+
margin: 0;
|
|
30
|
+
padding: 0;
|
|
31
|
+
list-style: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&__item {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: flex-start;
|
|
37
|
+
gap: 0.5rem;
|
|
38
|
+
color: var(--neutral-neutral-2);
|
|
39
|
+
font-size: 0.875rem;
|
|
40
|
+
font-weight: 400;
|
|
41
|
+
line-height: 1.125rem;
|
|
42
|
+
letter-spacing: -0.0214em;
|
|
43
|
+
|
|
44
|
+
img {
|
|
45
|
+
display: block;
|
|
46
|
+
width: 1.125rem;
|
|
47
|
+
height: 1.125rem;
|
|
48
|
+
flex: 0 0 1.125rem;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@media (max-width: ${size.tab}) {
|
|
54
|
+
padding: 1rem;
|
|
55
|
+
}
|
|
56
|
+
`;
|