@comicrelief/component-library 7.24.0 → 7.24.2

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.
Files changed (278) hide show
  1. package/.github/workflows/main.yml +22 -24
  2. package/dist/components/Atoms/Button/Button.js +21 -15
  3. package/dist/components/Atoms/Button/Button.test.js +3 -3
  4. package/dist/components/Atoms/ButtonWithStates/ButtonWithStates.js +19 -22
  5. package/dist/components/Atoms/Checkbox/Checkbox.js +42 -26
  6. package/dist/components/Atoms/Checkbox/Checkbox.test.js +3 -3
  7. package/dist/components/Atoms/Confetti/Confetti.js +20 -23
  8. package/dist/components/Atoms/Confetti/_TriggerConfetti.js +4 -11
  9. package/dist/components/Atoms/ErrorText/ErrorText.js +15 -11
  10. package/dist/components/Atoms/ErrorText/ErrorText.test.js +3 -3
  11. package/dist/components/Atoms/Icons/Arrow.js +16 -15
  12. package/dist/components/Atoms/Icons/AtSign.js +9 -9
  13. package/dist/components/Atoms/Icons/Chevron.js +16 -15
  14. package/dist/components/Atoms/Icons/Curve.js +16 -18
  15. package/dist/components/Atoms/Icons/Download.js +8 -8
  16. package/dist/components/Atoms/Icons/External.js +8 -8
  17. package/dist/components/Atoms/Icons/Favourite.js +8 -8
  18. package/dist/components/Atoms/Icons/Internal.js +8 -8
  19. package/dist/components/Atoms/Icons/index.js +8 -8
  20. package/dist/components/Atoms/Input/Input.js +38 -33
  21. package/dist/components/Atoms/Input/input.test.js +3 -3
  22. package/dist/components/Atoms/Label/Label.js +28 -23
  23. package/dist/components/Atoms/Link/Link.js +24 -29
  24. package/dist/components/Atoms/Link/Link.style.js +51 -40
  25. package/dist/components/Atoms/Link/Link.test.js +9 -9
  26. package/dist/components/Atoms/Logo/Logo.js +16 -18
  27. package/dist/components/Atoms/Logo/Logo.test.js +3 -3
  28. package/dist/components/Atoms/Pagination/Item/Item.js +7 -7
  29. package/dist/components/Atoms/Pagination/Item/Item.style.js +35 -28
  30. package/dist/components/Atoms/Pagination/List/List.js +21 -19
  31. package/dist/components/Atoms/Pagination/Pagination.js +41 -49
  32. package/dist/components/Atoms/Pagination/Pagination.test.js +54 -108
  33. package/dist/components/Atoms/Pagination/Utils/PaginationCalculator.js +15 -15
  34. package/dist/components/Atoms/Picture/Picture.js +34 -44
  35. package/dist/components/Atoms/Picture/Picture.test.js +5 -5
  36. package/dist/components/Atoms/RadioButton/RadioButton.js +35 -23
  37. package/dist/components/Atoms/RadioButton/RadioButton.test.js +3 -3
  38. package/dist/components/Atoms/RichText/RichText.js +9 -11
  39. package/dist/components/Atoms/RichText/RichText.test.js +4 -4
  40. package/dist/components/Atoms/Select/Select.js +56 -49
  41. package/dist/components/Atoms/Select/Select.test.js +3 -3
  42. package/dist/components/Atoms/SocialIcons/Icon/Icon.js +13 -13
  43. package/dist/components/Atoms/SocialIcons/SocialIcons.js +25 -23
  44. package/dist/components/Atoms/SocialIcons/SocialIcons.test.js +7 -7
  45. package/dist/components/Atoms/SocialIcons/Utils/Icons.js +3 -3
  46. package/dist/components/Atoms/SocialIcons/Utils/Links.js +19 -20
  47. package/dist/components/Atoms/SocialIcons/assets/X-white-Subtract.svg +3 -0
  48. package/dist/components/Atoms/Text/Text.js +62 -41
  49. package/dist/components/Atoms/Text/Text.test.js +11 -11
  50. package/dist/components/Atoms/TextArea/TextArea.js +18 -17
  51. package/dist/components/Atoms/TextArea/TextArea.test.js +3 -3
  52. package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.js +69 -86
  53. package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.style.js +23 -15
  54. package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.test.js +15 -19
  55. package/dist/components/Molecules/Accordion/Accordion.js +35 -32
  56. package/dist/components/Molecules/Accordion/Accordion.test.js +3 -3
  57. package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.js +81 -52
  58. package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +5 -5
  59. package/dist/components/Molecules/Banner/Banner.js +21 -13
  60. package/dist/components/Molecules/Banner/Banner.test.js +3 -3
  61. package/dist/components/Molecules/Box/Box.js +33 -27
  62. package/dist/components/Molecules/Box/Box.test.js +5 -5
  63. package/dist/components/Molecules/Card/Card.js +22 -22
  64. package/dist/components/Molecules/Card/Card.test.js +5 -5
  65. package/dist/components/Molecules/CardDs/CardDs.js +80 -55
  66. package/dist/components/Molecules/CardDs/CardDs.test.js +3 -3
  67. package/dist/components/Molecules/Chip/Chip.js +8 -6
  68. package/dist/components/Molecules/Chip/Chip.style.js +48 -28
  69. package/dist/components/Molecules/Chip/Chip.test.js +4 -6
  70. package/dist/components/Molecules/Countdown/Countdown.js +28 -36
  71. package/dist/components/Molecules/Countdown/Countdown.style.js +3 -3
  72. package/dist/components/Molecules/Descriptor/Descriptor.js +32 -26
  73. package/dist/components/Molecules/Descriptor/Descriptor.test.js +5 -5
  74. package/dist/components/Molecules/DoubleCopy/DoubleCopy.js +6 -4
  75. package/dist/components/Molecules/DoubleCopy/DoubleCopy.style.js +7 -5
  76. package/dist/components/Molecules/DoubleCopy/DoubleCopy.test.js +4 -4
  77. package/dist/components/Molecules/HeroBanner/HeroBanner.js +13 -17
  78. package/dist/components/Molecules/InfoBanner/InfoBanner.js +22 -18
  79. package/dist/components/Molecules/InfoBanner/InfoBanner.test.js +10 -10
  80. package/dist/components/Molecules/Logos/Logos.js +26 -14
  81. package/dist/components/Molecules/Logos/Logos.md +5 -0
  82. package/dist/components/Molecules/Lookup/Lookup.js +49 -84
  83. package/dist/components/Molecules/PartnerLink/PartnerLink.js +10 -11
  84. package/dist/components/Molecules/PartnerLink/PartnerLink.style.js +15 -9
  85. package/dist/components/Molecules/PartnerLink/PartnerLink.test.js +3 -3
  86. package/dist/components/Molecules/Promo/Promo.js +30 -36
  87. package/dist/components/Molecules/Promo/Promo.style.js +44 -31
  88. package/dist/components/Molecules/Promo/Promo.test.js +6 -6
  89. package/dist/components/Molecules/Promo/_ProgressRing.js +13 -19
  90. package/dist/components/Molecules/Promo/_PromoVideo.js +25 -34
  91. package/dist/components/Molecules/Promo/_PromoVideoButton.js +7 -7
  92. package/dist/components/Molecules/Promo/_PromoVideoButton.style.js +68 -41
  93. package/dist/components/Molecules/SchoolLookup/SchoolLookup.js +29 -52
  94. package/dist/components/Molecules/SchoolLookup/SchoolLookup.test.js +4 -4
  95. package/dist/components/Molecules/SearchInput/SearchInput.js +8 -8
  96. package/dist/components/Molecules/SearchInput/SearchInput.style.js +22 -14
  97. package/dist/components/Molecules/SearchInput/SearchInput.test.js +4 -4
  98. package/dist/components/Molecules/SearchResult/SearchResult.js +43 -29
  99. package/dist/components/Molecules/SearchResult/SearchResult.test.js +9 -9
  100. package/dist/components/Molecules/ShareButton/ShareButton.js +22 -26
  101. package/dist/components/Molecules/ShareButton/ShareButton.style.js +5 -5
  102. package/dist/components/Molecules/ShareButton/ShareButton.test.js +3 -3
  103. package/dist/components/Molecules/ShareButton/assets/ShareIcons.js +2 -2
  104. package/dist/components/Molecules/SimpleSchoolLookup/SimpleSchoolLookup.js +28 -55
  105. package/dist/components/Molecules/SingleMessage/SingleMessage.js +99 -123
  106. package/dist/components/Molecules/SingleMessage/SingleMessage.style.js +132 -81
  107. package/dist/components/Molecules/SingleMessage/SingleMessage.test.js +13 -13
  108. package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.js +31 -40
  109. package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.style.js +85 -49
  110. package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.test.js +3 -3
  111. package/dist/components/Molecules/Typeahead/Typeahead.js +47 -84
  112. package/dist/components/Molecules/Typeahead/Typeahead.test.js +12 -35
  113. package/dist/components/Molecules/VideoBanner/VideoBanner.js +20 -25
  114. package/dist/components/Molecules/VideoBanner/VideoBanner.test.js +4 -4
  115. package/dist/components/Organisms/CookieBanner/CookieBanner.js +7 -5
  116. package/dist/components/Organisms/CookieBanner/CookieBanner.style.js +21 -13
  117. package/dist/components/Organisms/CookieBanner/CookieBanner.test.js +5 -5
  118. package/dist/components/Organisms/Donate/Donate.js +34 -37
  119. package/dist/components/Organisms/Donate/Donate.style.js +85 -53
  120. package/dist/components/Organisms/Donate/Donate.test.js +10 -10
  121. package/dist/components/Organisms/Donate/Form/Form.js +53 -78
  122. package/dist/components/Organisms/Donate/Form/PopUpComponent.js +25 -30
  123. package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.js +11 -13
  124. package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.style.js +38 -22
  125. package/dist/components/Organisms/Donate/MoneyBuy/MoneyBuy.js +47 -30
  126. package/dist/components/Organisms/EmailSignUp/EmailSignUp.style.js +63 -37
  127. package/dist/components/Organisms/EmailSignUp/EmailSignUp.test.js +12 -12
  128. package/dist/components/Organisms/EmailSignUp/EmailSignUpForm.js +23 -43
  129. package/dist/components/Organisms/EmailSignUp/_EmailSignUp.js +25 -21
  130. package/dist/components/Organisms/EmailSignUp/_EmailSignUpConfig.js +10 -9
  131. package/dist/components/Organisms/EmailSignUp/_TextInput.js +20 -18
  132. package/dist/components/Organisms/Footer/Footer.js +10 -10
  133. package/dist/components/Organisms/Footer/Footer.style.js +27 -21
  134. package/dist/components/Organisms/Footer/Footer.test.js +3 -3
  135. package/dist/components/Organisms/Footer/Nav/Nav.js +59 -70
  136. package/dist/components/Organisms/Footer/Nav/Nav.style.js +77 -43
  137. package/dist/components/Organisms/Header/Burger/BurgerMenu.js +6 -4
  138. package/dist/components/Organisms/Header/Burger/BurgerMenu.style.js +37 -21
  139. package/dist/components/Organisms/Header/Header.js +8 -8
  140. package/dist/components/Organisms/Header/Header.style.js +27 -19
  141. package/dist/components/Organisms/Header/Nav/Nav.js +39 -50
  142. package/dist/components/Organisms/Header/Nav/Nav.style.js +103 -57
  143. package/dist/components/Organisms/Header/header.test.js +1 -1
  144. package/dist/components/Organisms/ImpactSlider/ImpactMoneybuys.style.js +32 -29
  145. package/dist/components/Organisms/ImpactSlider/ImpactSlider.js +19 -22
  146. package/dist/components/Organisms/ImpactSlider/ImpactSlider.style.js +38 -24
  147. package/dist/components/Organisms/ImpactSlider/Slider.style.js +8 -14
  148. package/dist/components/Organisms/ImpactSlider/_ImpactMoneybuys.js +11 -11
  149. package/dist/components/Organisms/ImpactSlider/_Slider.js +9 -7
  150. package/dist/components/Organisms/ImpactSlider/_utils.js +11 -11
  151. package/dist/components/Organisms/MarketingPreferencesDS/MarketingPreferencesDS.style.js +61 -38
  152. package/dist/components/Organisms/MarketingPreferencesDS/MarketingPreferencesDSForm.js +24 -16
  153. package/dist/components/Organisms/MarketingPreferencesDS/_AssociatedFields.js +1 -1
  154. package/dist/components/Organisms/MarketingPreferencesDS/_CheckAnswer.js +20 -16
  155. package/dist/components/Organisms/MarketingPreferencesDS/_DefaultCopy.js +3 -3
  156. package/dist/components/Organisms/MarketingPreferencesDS/_MarketingPreferencesDS.js +46 -36
  157. package/dist/components/Organisms/MarketingPreferencesDS/_MarketingPrefsConfig.js +21 -34
  158. package/dist/components/Organisms/MarketingPreferencesDS/_TextInput.js +20 -18
  159. package/dist/components/Organisms/Membership/Form/Form.js +48 -81
  160. package/dist/components/Organisms/Membership/Membership.js +17 -15
  161. package/dist/components/Organisms/Membership/Membership.style.js +81 -51
  162. package/dist/components/Organisms/Membership/Membership.test.js +4 -4
  163. package/dist/components/Organisms/Membership/MoneyBox/MoneyBox.js +37 -26
  164. package/dist/hoc/shallowWithTheme.js +1 -1
  165. package/dist/index.js +67 -67
  166. package/dist/styleguide/CRLogo.js +2 -2
  167. package/dist/styleguide/StyleGuideRenderer.js +9 -7
  168. package/dist/styleguide/ThemeWrapper.js +5 -3
  169. package/dist/styleguide/data/data.js +3 -3
  170. package/dist/theme/crTheme/buttonColors.js +6 -5
  171. package/dist/theme/crTheme/colors.js +4 -3
  172. package/dist/theme/crTheme/fontSizes.js +4 -3
  173. package/dist/theme/crTheme/linkStyles.js +6 -5
  174. package/dist/theme/crTheme/theme.js +1 -1
  175. package/dist/theme/shared/breakpoint.js +4 -3
  176. package/dist/theme/shared/fontFamilies.js +5 -4
  177. package/dist/theme/shared/hideVisually.js +1 -1
  178. package/dist/theme/shared/size.js +4 -3
  179. package/dist/theme/shared/spacing.js +2 -2
  180. package/dist/theme/shared/zIndex.js +3 -3
  181. package/dist/theme/srTheme/buttonColors.js +6 -5
  182. package/dist/theme/srTheme/colors.js +4 -3
  183. package/dist/theme/srTheme/fontSizes.js +4 -3
  184. package/dist/theme/srTheme/linkStyles.js +6 -5
  185. package/dist/theme/srTheme/theme.js +1 -1
  186. package/dist/utils/Membership.js +30 -27
  187. package/dist/utils/ShareButton/sharePopUpHelper.js +8 -8
  188. package/dist/utils/ShareButton/shareTracking.js +1 -1
  189. package/dist/utils/ShareButton/shareUrlHelper.js +3 -3
  190. package/dist/utils/allowListed.js +3 -5
  191. package/dist/utils/allowListed.test.js +3 -3
  192. package/dist/utils/internalLinkHelper.js +8 -10
  193. package/dist/utils/navHelper.js +2 -2
  194. package/package.json +12 -9
  195. package/playwright/components/atoms/checkbox.spec.js +64 -0
  196. package/playwright/components/atoms/input.spec.js +158 -0
  197. package/playwright/components/atoms/label.spec.js +29 -0
  198. package/playwright/components/atoms/link.spec.js +48 -0
  199. package/playwright/components/atoms/radioButton.spec.js +30 -0
  200. package/playwright/components/atoms/select.spec.js +36 -0
  201. package/playwright/components/atoms/textArea.spec.js +39 -0
  202. package/playwright/components/atoms/textInputWithDropdown.spec.js +23 -0
  203. package/playwright/components/molecules/accordian.spec.js +20 -0
  204. package/playwright/components/molecules/schoolLookup.spec.js +26 -0
  205. package/playwright/components/molecules/searchInput.spec.js +24 -0
  206. package/playwright/components/molecules/shareButton.spec.js +32 -0
  207. package/playwright/components/molecules/simpleSchoolLookUp.spec.js +35 -0
  208. package/playwright/components/molecules/typeahead.spec.js +27 -0
  209. package/playwright/components/organisms/donate.spec.js +293 -0
  210. package/playwright/components/organisms/emailSignUpForm.spec.js +109 -0
  211. package/playwright/components/organisms/footer.spec.js +67 -0
  212. package/playwright/components/organisms/header.spec.js +82 -0
  213. package/playwright/components/organisms/impactSlider.spec.js +292 -0
  214. package/playwright/components/organisms/marketingPreferences.spec.js +220 -0
  215. package/playwright/components/organisms/membership.spec.js +47 -0
  216. package/playwright.config.js +49 -0
  217. package/src/components/Atoms/SocialIcons/Utils/Icons.js +1 -1
  218. package/src/components/Atoms/SocialIcons/assets/X-white-Subtract.svg +3 -0
  219. package/src/components/Molecules/Logos/Logos.js +18 -6
  220. package/src/components/Molecules/Logos/Logos.md +5 -0
  221. package/src/components/Organisms/ImpactSlider/_ImpactMoneybuys.js +3 -4
  222. package/src/components/Organisms/Membership/Membership.test.js +1 -1
  223. package/cypress/e2e/components/atoms/button.cy.js +0 -102
  224. package/cypress/e2e/components/atoms/buttonWithStates.cy.js +0 -47
  225. package/cypress/e2e/components/atoms/checkbox.cy.js +0 -70
  226. package/cypress/e2e/components/atoms/confetti.cy.js +0 -46
  227. package/cypress/e2e/components/atoms/errorText.cy.js +0 -45
  228. package/cypress/e2e/components/atoms/input.cy.js +0 -157
  229. package/cypress/e2e/components/atoms/label.cy.js +0 -93
  230. package/cypress/e2e/components/atoms/link.cy.js +0 -190
  231. package/cypress/e2e/components/atoms/logo.cy.js +0 -132
  232. package/cypress/e2e/components/atoms/pagination.cy.js +0 -191
  233. package/cypress/e2e/components/atoms/picture.cy.js +0 -130
  234. package/cypress/e2e/components/atoms/radioButton.cy.js +0 -76
  235. package/cypress/e2e/components/atoms/richText.cy.js +0 -70
  236. package/cypress/e2e/components/atoms/select.cy.js +0 -84
  237. package/cypress/e2e/components/atoms/socialIcons.cy.js +0 -162
  238. package/cypress/e2e/components/atoms/text.cy.js +0 -169
  239. package/cypress/e2e/components/atoms/textArea.cy.js +0 -89
  240. package/cypress/e2e/components/atoms/textInputWithDrop.cy.js +0 -76
  241. package/cypress/e2e/components/molecules/accordion.cy.js +0 -67
  242. package/cypress/e2e/components/molecules/articleTeaser.cy.js +0 -105
  243. package/cypress/e2e/components/molecules/banner.cy.js +0 -67
  244. package/cypress/e2e/components/molecules/box.cy.js +0 -104
  245. package/cypress/e2e/components/molecules/card.cy.js +0 -105
  246. package/cypress/e2e/components/molecules/cardDs.cy.js +0 -198
  247. package/cypress/e2e/components/molecules/chip.cy.js +0 -68
  248. package/cypress/e2e/components/molecules/countdown.cy.js +0 -71
  249. package/cypress/e2e/components/molecules/descriptor.cy.js +0 -142
  250. package/cypress/e2e/components/molecules/doubleCopy.cy.js +0 -79
  251. package/cypress/e2e/components/molecules/heroBanner.cy.js +0 -69
  252. package/cypress/e2e/components/molecules/infoBanner.cy.js +0 -69
  253. package/cypress/e2e/components/molecules/partnerLink.cy.js +0 -68
  254. package/cypress/e2e/components/molecules/promo.cy.js +0 -74
  255. package/cypress/e2e/components/molecules/schoolLookup.cy.js +0 -83
  256. package/cypress/e2e/components/molecules/searchInput.cy.js +0 -72
  257. package/cypress/e2e/components/molecules/searchResult.cy.js +0 -191
  258. package/cypress/e2e/components/molecules/shareButton.cy.js +0 -76
  259. package/cypress/e2e/components/molecules/simpleSchoolLookup.cy.js +0 -83
  260. package/cypress/e2e/components/molecules/singleMessage.cy.js +0 -502
  261. package/cypress/e2e/components/molecules/singleMessageDs.cy.js +0 -234
  262. package/cypress/e2e/components/molecules/typeahead.cy.js +0 -97
  263. package/cypress/e2e/components/molecules/videoBanner.cy.js +0 -132
  264. package/cypress/e2e/components/organisms/cookieBanner.cy.js +0 -80
  265. package/cypress/e2e/components/organisms/donate.cy.js +0 -284
  266. package/cypress/e2e/components/organisms/emailSignUp.cy.js +0 -54
  267. package/cypress/e2e/components/organisms/footer.cy.js +0 -168
  268. package/cypress/e2e/components/organisms/header.cy.js +0 -138
  269. package/cypress/e2e/components/organisms/impactSlider.cy.js +0 -72
  270. package/cypress/e2e/components/organisms/marketingPreferencesDSForm.cy.js +0 -589
  271. package/cypress/e2e/components/organisms/membership.cy.js +0 -122
  272. package/cypress/fixtures/example.json +0 -5
  273. package/cypress/plugins/index.js +0 -21
  274. package/cypress/support/commands.js +0 -25
  275. package/cypress/support/e2e.js +0 -36
  276. package/cypress.config.js +0 -15
  277. package/dist/components/Atoms/SocialIcons/assets/x-logo.svg +0 -3
  278. package/src/components/Atoms/SocialIcons/assets/x-logo.svg +0 -3
@@ -1,68 +0,0 @@
1
- describe('PartnerLink component', () => {
2
- before(() => {
3
- // go to partnerLink component
4
- cy.visit('/#partnerlink');
5
- });
6
-
7
- describe('props and methods section', () => {
8
- beforeEach(() => {
9
- cy.visit('/#partnerlink');
10
- cy.get('[data-testid="PartnerLink-container"] button[name="rsg-usage"]')
11
- .contains('Props & methods')
12
- .as('propsBtn');
13
-
14
- cy.get('@propsBtn')
15
- .closest('[class^=rsg--tabs]')
16
- .as('container');
17
- });
18
-
19
- it('is present', () => {
20
- cy.get('@propsBtn').should('exist');
21
- });
22
-
23
- it('does not show table initially', () => {
24
- cy.get('@container')
25
- .find('table')
26
- .should('not.exist');
27
- });
28
-
29
- it('shows the table on button click', () => {
30
- cy.get('@propsBtn').click();
31
- cy.get('@container')
32
- .find('table')
33
- .should('contain', 'Prop name');
34
- });
35
- });
36
-
37
- describe('Partnerlink section', () => {
38
- beforeEach(() => {
39
- cy.visit('/#partnerlink');
40
- cy.get('[data-testid="PartnerLink-example-1"]')
41
- .as('container')
42
- .find('[data-preview="PartnerLink"]')
43
- .as('preview');
44
-
45
- cy.get('@container')
46
- .find('button')
47
- .contains('View Code')
48
- .as('viewCodeBtn');
49
- });
50
-
51
- it('renders Partnerlink preview', () => {
52
- cy.get('@container')
53
- .find('span')
54
- .contains('Find out more')
55
- });
56
-
57
- it('has view code button', () => {
58
- cy.get('@viewCodeBtn').should('exist');
59
- });
60
-
61
- it('shows code on click', () => {
62
- cy.get('@viewCodeBtn').click();
63
- cy.get('@container')
64
- .find('textarea')
65
- .should('exist');
66
- });
67
- });
68
- });
@@ -1,74 +0,0 @@
1
- describe('Promo component', () => {
2
- before(() => {
3
- // go to promo component
4
- cy.visit('/#promo');
5
- });
6
-
7
- describe('props and methods section', () => {
8
- beforeEach(() => {
9
- cy.visit('/#promo');
10
- cy.get('[data-testid="Promo-container"] button[name="rsg-usage"]')
11
- .contains('Props & methods')
12
- .as('propsBtn');
13
-
14
- cy.get('@propsBtn')
15
- .closest('[class^=rsg--tabs]')
16
- .as('container');
17
- });
18
-
19
- it('is present', () => {
20
- cy.get('@propsBtn').should('exist');
21
- });
22
-
23
- it('does not show table initially', () => {
24
- cy.get('@container')
25
- .find('table')
26
- .should('not.exist');
27
- });
28
-
29
- it('shows the table on button click', () => {
30
- cy.get('@propsBtn').click();
31
- cy.get('@container')
32
- .find('table')
33
- .should('contain', 'Prop name');
34
- });
35
- });
36
-
37
- describe('Promo section', () => {
38
- beforeEach(() => {
39
- cy.visit('/#promo');
40
- cy.get('[data-testid="Promo-example-1"]')
41
- .as('container')
42
- .find('[data-preview="Promo"]')
43
- .as('preview');
44
-
45
- cy.get('@container')
46
- .find('button')
47
- .contains('View Code')
48
- .as('viewCodeBtn');
49
- });
50
-
51
- it('renders Promo preview', () => {
52
- cy.get('@container')
53
- .find('h1')
54
- .should('exist');
55
- cy.get('@container')
56
- .find('p')
57
- .should('exist');
58
- cy.get('@container')
59
- .find('span')
60
- .should('exist')
61
- });
62
-
63
- it('has view code button', () => {
64
- cy.get('@viewCodeBtn').should('exist');
65
- });
66
-
67
- it('shows code on click', () => {
68
- cy.get('@viewCodeBtn').click();
69
- cy.get('@container')
70
- .find('textarea')
71
- .should('exist');
72
- });
73
- });
74
- });
@@ -1,83 +0,0 @@
1
- describe('School Lookup component', () => {
2
- before(() => {
3
- // go to school lookup component
4
- cy.visit('/#schoollookup');
5
- });
6
-
7
- describe('props and methods section', () => {
8
- beforeEach(() => {
9
- cy.visit('/#schoollookup');
10
- cy.get('[data-testid="SchoolLookup-container"] button[name="rsg-usage"]')
11
- .contains('Props & methods')
12
- .as('propsBtn');
13
-
14
- cy.get('@propsBtn')
15
- .closest('[class^=rsg--tabs]')
16
- .as('container');
17
- });
18
-
19
- it('is present', () => {
20
- cy.get('@propsBtn').should('exist');
21
- });
22
-
23
- it('does not show table initially', () => {
24
- cy.get('@container')
25
- .find('table')
26
- .should('not.exist');
27
- });
28
-
29
- it('shows the table on button click', () => {
30
- cy.get('@propsBtn').click();
31
- cy.get('@container')
32
- .find('table')
33
- .should('contain', 'Prop name');
34
- });
35
- });
36
-
37
- describe('view code section', () => {
38
- beforeEach(() => {
39
- cy.visit('/#schoollookup');
40
- cy.get('[data-testid="SchoolLookup-example-1"]')
41
- .as('container')
42
- .find('[data-preview="SchoolLookup"]')
43
- .as('preview');
44
-
45
- cy.get('@container')
46
- .find('button')
47
- .contains('View Code')
48
- .as('viewCodeBtn');
49
- });
50
-
51
- it('has view code button', () => {
52
- cy.get('@viewCodeBtn').should('exist');
53
- });
54
-
55
- it('shows code on click', () => {
56
- cy.get('@viewCodeBtn').click();
57
- cy.get('@container')
58
- .find('textarea')
59
- .should('exist');
60
- });
61
- });
62
-
63
- describe('School lookup functionality', () => {
64
- beforeEach(() => {
65
- cy.visit('/#schoollookup');
66
- cy.get('[data-testid="SchoolLookup-example-1"]')
67
- .as('container')
68
- .find('[data-preview="SchoolLookup"]')
69
- .as('preview');
70
-
71
- cy.get('@container')
72
- .find('button')
73
- .contains('View Code')
74
- .as('viewCodeBtn');
75
- });
76
-
77
- it('it should show address when school postcode is entered', () => {
78
- cy.get('@preview')
79
- .find('input#school-lookup')
80
- .should('exist');
81
- });
82
- });
83
- });
@@ -1,72 +0,0 @@
1
- describe('Search Input component', () => {
2
- before(() => {
3
- // go to search input component
4
- cy.visit('/#searchinput');
5
- });
6
-
7
- describe('props and methods section', () => {
8
- beforeEach(() => {
9
- cy.visit('/#searchinput');
10
- cy.get('[data-testid="SearchInput-container"] button[name="rsg-usage"]')
11
- .contains('Props & methods')
12
- .as('propsBtn');
13
-
14
- cy.get('@propsBtn')
15
- .closest('[class^=rsg--tabs]')
16
- .as('container');
17
- });
18
-
19
- it('is present', () => {
20
- cy.get('@propsBtn').should('exist');
21
- });
22
-
23
- it('does not show table initially', () => {
24
- cy.get('@container')
25
- .find('table')
26
- .should('not.exist');
27
- });
28
-
29
- it('shows the table on button click', () => {
30
- cy.get('@propsBtn').click();
31
- cy.get('@container')
32
- .find('table')
33
- .should('contain', 'Prop name');
34
- });
35
- });
36
-
37
- describe('Search Input section', () => {
38
- beforeEach(() => {
39
- cy.visit('/#searchinput');
40
- cy.get('[data-testid="SearchInput-example-1"]')
41
- .as('container')
42
- .find('[data-preview="SearchInput"]')
43
- .as('preview');
44
-
45
- cy.get('@container')
46
- .find('button')
47
- .contains('View Code')
48
- .as('viewCodeBtn');
49
- });
50
-
51
- it('renders search input preview', () => {
52
- cy.get('@container')
53
- .find('span')
54
- .should('exist')
55
- .contains('Search');
56
- cy.get('@container')
57
- .find('input')
58
- .type('test search');
59
- });
60
-
61
- it('has view code button', () => {
62
- cy.get('@viewCodeBtn').should('exist');
63
- });
64
-
65
- it('shows code on click', () => {
66
- cy.get('@viewCodeBtn').click();
67
- cy.get('@container')
68
- .find('textarea')
69
- .should('exist');
70
- });
71
- });
72
- });
@@ -1,191 +0,0 @@
1
- describe('Search Result component', () => {
2
- before(() => {
3
- // go to search input component
4
- cy.visit('/#searchresult');
5
- });
6
-
7
- describe('props and methods section', () => {
8
- beforeEach(() => {
9
- cy.visit('/#searchresult');
10
- cy.get('[data-testid="SearchResult-container"] button[name="rsg-usage"]')
11
- .contains('Props & methods')
12
- .as('propsBtn');
13
-
14
- cy.get('@propsBtn')
15
- .closest('[class^=rsg--tabs]')
16
- .as('container');
17
- });
18
-
19
- it('is present', () => {
20
- cy.get('@propsBtn').should('exist');
21
- });
22
-
23
- it('does not show table initially', () => {
24
- cy.get('@container')
25
- .find('table')
26
- .should('not.exist');
27
- });
28
-
29
- it('shows the table on button click', () => {
30
- cy.get('@propsBtn').click();
31
- cy.get('@container')
32
- .find('table')
33
- .should('contain', 'Prop name');
34
- });
35
- });
36
-
37
- describe('Search Result Minimalist section', () => {
38
- beforeEach(() => {
39
- cy.visit('/#searchresult');
40
- cy.get('[data-testid="SearchResult-example-1"]')
41
- .as('container')
42
- .find('[data-preview="SearchResult"]')
43
- .as('preview');
44
-
45
- cy.get('@container')
46
- .find('button')
47
- .contains('View Code')
48
- .as('viewCodeBtn');
49
- });
50
-
51
- it('renders minimalist preview', () => {
52
- cy.get('@container')
53
- .find('img')
54
- .should('exist');
55
- cy.get('@container')
56
- .find('h3')
57
- .contains('News article');
58
- });
59
-
60
- it('has view code button', () => {
61
- cy.get('@viewCodeBtn').should('exist');
62
- });
63
-
64
- it('shows code on click', () => {
65
- cy.get('@viewCodeBtn').click();
66
- cy.get('@container')
67
- .find('textarea')
68
- .should('exist');
69
- });
70
- });
71
-
72
- describe('Search Result with copy section', () => {
73
- beforeEach(() => {
74
- cy.visit('/#searchresult');
75
- cy.get('[data-testid="SearchResult-example-3"]')
76
- .as('container')
77
- .find('[data-preview="SearchResult"]')
78
- .as('preview');
79
-
80
- cy.get('@container')
81
- .find('button')
82
- .contains('View Code')
83
- .as('viewCodeBtn');
84
- });
85
-
86
- it('renders with copy preview', () => {
87
- cy.get('@container')
88
- .find('img')
89
- .should('exist');
90
- cy.get('@container')
91
- .find('h3')
92
- .contains('News article');
93
- cy.get('@container')
94
- .find('p')
95
- .contains('News article copy');
96
- });
97
-
98
- it('has view code button', () => {
99
- cy.get('@viewCodeBtn').should('exist');
100
- });
101
-
102
- it('shows code on click', () => {
103
- cy.get('@viewCodeBtn').click();
104
- cy.get('@container')
105
- .find('textarea')
106
- .should('exist');
107
- });
108
- });
109
-
110
- describe('Search Result with date section', () => {
111
- beforeEach(() => {
112
- cy.visit('/#searchresult');
113
- cy.get('[data-testid="SearchResult-example-5"]')
114
- .as('container')
115
- .find('[data-preview="SearchResult"]')
116
- .as('preview');
117
-
118
- cy.get('@container')
119
- .find('button')
120
- .contains('View Code')
121
- .as('viewCodeBtn');
122
- });
123
-
124
- it('renders with date preview', () => {
125
- cy.get('@container')
126
- .find('img')
127
- .should('exist');
128
- cy.get('@container')
129
- .find('span')
130
- .contains(' 01 July 2019');
131
- cy.get('@container')
132
- .find('h3')
133
- .contains('News article');
134
- cy.get('@container')
135
- .find('p')
136
- .should('not.exist');
137
- });
138
-
139
- it('has view code button', () => {
140
- cy.get('@viewCodeBtn').should('exist');
141
- });
142
-
143
- it('shows code on click', () => {
144
- cy.get('@viewCodeBtn').click();
145
- cy.get('@container')
146
- .find('textarea')
147
- .should('exist');
148
- });
149
- });
150
-
151
- describe('Search Result with date and type section', () => {
152
- beforeEach(() => {
153
- cy.visit('/#searchresult');
154
- cy.get('[data-testid="SearchResult-example-5"]')
155
- .as('container')
156
- .find('[data-preview="SearchResult"]')
157
- .as('preview');
158
-
159
- cy.get('@container')
160
- .find('button')
161
- .contains('View Code')
162
- .as('viewCodeBtn');
163
- });
164
-
165
- it('renders with date and type preview', () => {
166
- cy.get('@container')
167
- .find('img')
168
- .should('exist');
169
- cy.get('@container')
170
- .find('span')
171
- .contains(' 01 July 2019');
172
- cy.get('@container')
173
- .find('h3')
174
- .contains('News article');
175
- cy.get('@container')
176
- .find('p')
177
- .should('not.exist');
178
- });
179
-
180
- it('has view code button', () => {
181
- cy.get('@viewCodeBtn').should('exist');
182
- });
183
-
184
- it('shows code on click', () => {
185
- cy.get('@viewCodeBtn').click();
186
- cy.get('@container')
187
- .find('textarea')
188
- .should('exist');
189
- });
190
- });
191
- });
@@ -1,76 +0,0 @@
1
- describe('Share Button component', () => {
2
- before(() => {
3
- // go to share button component
4
- cy.visit('/#sharebutton');
5
- });
6
-
7
- describe('props and methods section', () => {
8
- beforeEach(() => {
9
- cy.visit('/#sharebutton');
10
- cy.get('[data-testid="ShareButton-container"] button[name="rsg-usage"]')
11
- .contains('Props & methods')
12
- .as('propsBtn');
13
-
14
- cy.get('@propsBtn')
15
- .closest('[class^=rsg--tabs]')
16
- .as('container');
17
- });
18
-
19
- it('is present', () => {
20
- cy.get('@propsBtn').should('exist');
21
- });
22
-
23
- it('does not show table initially', () => {
24
- cy.get('@container')
25
- .find('table')
26
- .should('not.exist');
27
- });
28
-
29
- it('shows the table on button click', () => {
30
- cy.get('@propsBtn').click();
31
- cy.get('@container')
32
- .find('table')
33
- .should('contain', 'Prop name');
34
- });
35
- });
36
-
37
- describe('Share Button section', () => {
38
- beforeEach(() => {
39
- cy.visit('/#sharebutton');
40
- cy.get('[data-testid="ShareButton-example-0"]')
41
- .as('container')
42
- .find('[data-preview="ShareButton"]')
43
- .as('preview');
44
- cy.get('@container')
45
- .find('button')
46
- .contains('View Code')
47
- .as('viewCodeBtn');
48
- });
49
-
50
- it('renders Share Button preview', () => {
51
- cy.get('@container')
52
- .find('p')
53
- .contains('Share with:');
54
- cy.get('@container')
55
- .find('ul > li:nth-child(1) > a')
56
- .should('exist');
57
- cy.get('@container')
58
- .find('ul > li:nth-child(2) > a')
59
- .should('exist');
60
- cy.get('@container')
61
- .find('div:nth-child(2) > p')
62
- .contains('Share some other page:');
63
- });
64
-
65
- it('has view code button', () => {
66
- cy.get('@viewCodeBtn').should('exist');
67
- });
68
-
69
- it('shows code on click', () => {
70
- cy.get('@viewCodeBtn').click();
71
- cy.get('@container')
72
- .find('textarea')
73
- .should('exist');
74
- });
75
- });
76
- });
@@ -1,83 +0,0 @@
1
- describe('SimpleSchoolLookup component', () => {
2
- before(() => {
3
- // go to simpleschoollookup component
4
- cy.visit('/#simpleschoollookup');
5
- });
6
-
7
- describe('props and methods section', () => {
8
- beforeEach(() => {
9
- cy.visit('/#simpleschoollookup');
10
- cy.get('[data-testid="SimpleSchoolLookup-container"] button[name="rsg-usage"]')
11
- .contains('Props & methods')
12
- .as('propsBtn');
13
-
14
- cy.get('@propsBtn')
15
- .closest('[class^=rsg--tabs]')
16
- .as('container');
17
- });
18
-
19
- it('is present', () => {
20
- cy.get('@propsBtn').should('exist');
21
- });
22
-
23
- it('does not show table initially', () => {
24
- cy.get('@container')
25
- .find('table')
26
- .should('not.exist');
27
- });
28
-
29
- it('shows the table on button click', () => {
30
- cy.get('@propsBtn').click();
31
- cy.get('@container')
32
- .find('table')
33
- .should('contain', 'Prop name');
34
- });
35
- });
36
-
37
- describe('view code section', () => {
38
- beforeEach(() => {
39
- cy.visit('/#simpleschoollookup');
40
- cy.get('[data-testid="SimpleSchoolLookup-examples"]')
41
- .as('container');
42
-
43
- cy.get('@container')
44
- .find('button')
45
- .contains('View Code')
46
- .as('viewCodeBtn');
47
- });
48
-
49
- it('has view code button', () => {
50
- cy.get('@viewCodeBtn').should('exist');
51
- });
52
-
53
- it('shows code on click', () => {
54
- cy.get('@viewCodeBtn').click();
55
- cy.get('@container')
56
- .find('textarea')
57
- .should('exist');
58
- });
59
- });
60
-
61
- describe('Simple School lookup functionality', () => {
62
- beforeEach(() => {
63
- cy.visit('/#simpleschoollookup');
64
- cy.get('[data-testid="SimpleSchoolLookup-example-0"]')
65
- .as('container')
66
- .find('[data-preview="SimpleSchoolLookup"]')
67
- .as('preview');
68
-
69
- cy.get('@container')
70
- .find('button')
71
- .contains('View Code')
72
- .as('viewCodeBtn');
73
- });
74
-
75
- it('it should show address when school postcode is entered', () => {
76
- cy.get('@container')
77
- .find('input#school_lookup')
78
- .type('RG1 4JJ')
79
- .get('[data-preview="SimpleSchoolLookup"] div > div > button')
80
- .should('exist');
81
- });
82
- });
83
- });