@financial-times/dotcom-ui-footer 8.2.1 → 8.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/dotcom-ui-footer",
3
- "version": "8.2.1",
3
+ "version": "8.2.3",
4
4
  "description": "",
5
5
  "main": "component.js",
6
6
  "styles": "styles.scss",
@@ -21,7 +21,7 @@
21
21
  "author": "",
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
- "@financial-times/dotcom-types-navigation": "^8.2.1"
24
+ "@financial-times/dotcom-types-navigation": "^8.2.3"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "react": "16.x || 17.x",
@@ -1,61 +1,83 @@
1
1
  /**
2
2
  * @jest-environment jsdom
3
3
  */
4
- import 'jest-enzyme'
5
4
  import React from 'react'
6
- import { mount } from 'enzyme'
5
+ import { render } from '@testing-library/react'
7
6
 
8
7
  import dataFixture from '../__stories__/story-data'
9
8
  import { Footer, LegalFooter } from '../index'
10
9
 
11
- describe('dotcom-ui-footer', () => {
12
- const footer = mount(<Footer {...dataFixture} />)
13
- const legalFooter = mount(<LegalFooter {...dataFixture} />)
14
-
10
+ describe('dotcom-ui-footer', () => {
15
11
  it('renders the available footer variants', () => {
16
- expect(footer).not.toBeEmptyRender()
17
- expect(legalFooter).not.toBeEmptyRender()
12
+ const footer = render(<Footer {...dataFixture} />)
13
+ const legalFooter = render(<LegalFooter {...dataFixture} />)
14
+ expect(footer).not.toBeNull()
15
+ expect(legalFooter).not.toBeNull()
18
16
  })
19
17
 
20
18
  it('renders the copyright section', () => {
21
- expect(footer.find('.o-footer__copyright')).toExist()
22
- expect(legalFooter.find('.o-footer__copyright')).toExist()
19
+ const { container: footerContainer } = render(<Footer {...dataFixture} /> )
20
+ const { container: legalFooterContainer } = render(<LegalFooter {...dataFixture} />)
21
+
22
+ expect(footerContainer.querySelector('.o-footer__copyright')).not.toBeNull()
23
+ expect(legalFooterContainer.querySelector('.o-footer__copyright')).not.toBeNull()
23
24
  })
24
25
 
25
26
  it('renders the Nikkei banner', () => {
26
- expect(footer.find('.o-footer__copyright')).toExist()
27
- expect(legalFooter.find('.o-footer__brand-logo')).toExist()
27
+ const { container: footerContainer } = render(<Footer {...dataFixture} /> )
28
+ const { container: legalFooterContainer } = render(<LegalFooter {...dataFixture} />)
29
+
30
+ expect(legalFooterContainer.querySelector('.o-footer__copyright')).not.toBeNull()
31
+ expect(footerContainer.querySelector('.o-footer__brand-logo')).not.toBeNull()
28
32
  })
29
33
 
30
34
  describe('standard footer', () => {
31
35
  it('renders the navigation sections', () => {
32
- expect(footer).not.toBeEmptyRender()
33
- expect(footer.find('.o-footer__matrix')).toIncludeText('Support')
34
- expect(footer.find('.o-footer__matrix')).toIncludeText('Legal & Privacy')
35
- expect(footer.find('.o-footer__matrix')).toIncludeText('Services')
36
- expect(footer.find('.o-footer__matrix')).toIncludeText('Tools')
36
+ const { container } = render(<Footer {...dataFixture} /> )
37
+
38
+ const matrix = container.querySelector('.o-footer__matrix')
39
+
40
+ expect(matrix).not.toBeNull()
41
+
42
+ expect(matrix?.innerHTML).toContain('Support')
43
+ expect(matrix?.innerHTML).toContain('Legal &amp; Privacy')
44
+ expect(matrix?.innerHTML).toContain('Services')
45
+ expect(matrix?.innerHTML).toContain('Tools')
37
46
  })
38
47
 
39
48
  it('does not render the legal links section', () => {
40
- expect(footer.find('.o-footer__legal-links')).not.toExist()
49
+ const { container } = render(<Footer {...dataFixture} /> )
50
+
51
+ const legalLinks = container.querySelector('.o-footer__legal-links')
52
+
53
+ expect(legalLinks).toBeNull()
41
54
  })
42
55
 
43
56
  it('renders the More from FT section', () => {
44
- expect(footer.find('.o-footer__matrix-link__copy')).toExist()
57
+ const { container } = render(<Footer {...dataFixture} /> )
58
+
59
+ const moreFromFt = container.querySelector('.o-footer__matrix-link__copy')
60
+ expect(moreFromFt).not.toBeNull()
45
61
  })
46
62
  })
47
63
 
48
64
  describe('legal footer', () => {
49
65
  it('does not render the navigation sections', () => {
50
- expect(legalFooter.find('.o-footer__matrix')).not.toExist()
66
+ const { container } = render(<LegalFooter {...dataFixture} /> )
67
+
68
+ expect(container.querySelector('.o-footer__matrix')).toBeNull()
51
69
  })
52
70
 
53
71
  it('renders the legal links section', () => {
54
- expect(legalFooter.find('.o-footer__legal-links')).toExist()
72
+ const { container } = render(<LegalFooter {...dataFixture} /> )
73
+
74
+ expect(container.querySelector('.o-footer__legal-links')).not.toBeNull()
55
75
  })
56
76
 
57
77
  it('does not render the More from FT section', () => {
58
- expect(legalFooter.find('.o-footer__more-from-ft')).not.toExist()
78
+ const { container } = render(<LegalFooter {...dataFixture} /> )
79
+
80
+ expect(container.querySelector('.o-footer__more-from-ft')).toBeNull()
59
81
  })
60
82
  })
61
83
  })
@@ -65,7 +65,8 @@ const FooterContents = ({ footerData }: TFooterContentsProps) => (
65
65
  return (
66
66
  <div
67
67
  key={`group-${index}`}
68
- className={`o-footer__matrix-group o-footer__matrix-group--${submenu.length}`}>
68
+ className={`o-footer__matrix-group o-footer__matrix-group--${submenu.length}`}
69
+ >
69
70
  <SectionTitle label={item.label} index={index} />
70
71
  <SectionLinks submenu={submenu} index={index} />
71
72
  </div>
@@ -76,7 +77,8 @@ const FooterContents = ({ footerData }: TFooterContentsProps) => (
76
77
  <a
77
78
  className="o-footer__matrix-link o-footer__matrix-link--more"
78
79
  id={`o-footer-${footerData.length}`}
79
- href="https://ft.com/more-from-ft-group">
80
+ href="https://ft.com/more-from-ft-group"
81
+ >
80
82
  <span className="o-footer__matrix-link__copy">More from the FT Group</span>
81
83
  </a>
82
84
  </h3>
@@ -97,7 +99,7 @@ const CopyrightNotice = ({ withoutMarketsData = false }) => {
97
99
  and ‘Financial Times’ are trademarks of The Financial Times Ltd.
98
100
  <br />
99
101
  The Financial Times and its journalism are subject to a self-regulation regime under the{' '}
100
- <a href="http://aboutus.ft.com/en-gb/ft-editorial-code/" aria-label="F T Editorial Code of Practice">
102
+ <a href="https://aboutus.ft.com/en-gb/ft-editorial-code/" aria-label="F T Editorial Code of Practice">
101
103
  FT Editorial Code of Practice
102
104
  </a>
103
105
  .