@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.
- package/.github/workflows/main.yml +22 -24
- package/dist/components/Atoms/Button/Button.js +21 -15
- package/dist/components/Atoms/Button/Button.test.js +3 -3
- package/dist/components/Atoms/ButtonWithStates/ButtonWithStates.js +19 -22
- package/dist/components/Atoms/Checkbox/Checkbox.js +42 -26
- package/dist/components/Atoms/Checkbox/Checkbox.test.js +3 -3
- package/dist/components/Atoms/Confetti/Confetti.js +20 -23
- package/dist/components/Atoms/Confetti/_TriggerConfetti.js +4 -11
- package/dist/components/Atoms/ErrorText/ErrorText.js +15 -11
- package/dist/components/Atoms/ErrorText/ErrorText.test.js +3 -3
- package/dist/components/Atoms/Icons/Arrow.js +16 -15
- package/dist/components/Atoms/Icons/AtSign.js +9 -9
- package/dist/components/Atoms/Icons/Chevron.js +16 -15
- package/dist/components/Atoms/Icons/Curve.js +16 -18
- package/dist/components/Atoms/Icons/Download.js +8 -8
- package/dist/components/Atoms/Icons/External.js +8 -8
- package/dist/components/Atoms/Icons/Favourite.js +8 -8
- package/dist/components/Atoms/Icons/Internal.js +8 -8
- package/dist/components/Atoms/Icons/index.js +8 -8
- package/dist/components/Atoms/Input/Input.js +38 -33
- package/dist/components/Atoms/Input/input.test.js +3 -3
- package/dist/components/Atoms/Label/Label.js +28 -23
- package/dist/components/Atoms/Link/Link.js +24 -29
- package/dist/components/Atoms/Link/Link.style.js +51 -40
- package/dist/components/Atoms/Link/Link.test.js +9 -9
- package/dist/components/Atoms/Logo/Logo.js +16 -18
- package/dist/components/Atoms/Logo/Logo.test.js +3 -3
- package/dist/components/Atoms/Pagination/Item/Item.js +7 -7
- package/dist/components/Atoms/Pagination/Item/Item.style.js +35 -28
- package/dist/components/Atoms/Pagination/List/List.js +21 -19
- package/dist/components/Atoms/Pagination/Pagination.js +41 -49
- package/dist/components/Atoms/Pagination/Pagination.test.js +54 -108
- package/dist/components/Atoms/Pagination/Utils/PaginationCalculator.js +15 -15
- package/dist/components/Atoms/Picture/Picture.js +34 -44
- package/dist/components/Atoms/Picture/Picture.test.js +5 -5
- package/dist/components/Atoms/RadioButton/RadioButton.js +35 -23
- package/dist/components/Atoms/RadioButton/RadioButton.test.js +3 -3
- package/dist/components/Atoms/RichText/RichText.js +9 -11
- package/dist/components/Atoms/RichText/RichText.test.js +4 -4
- package/dist/components/Atoms/Select/Select.js +56 -49
- package/dist/components/Atoms/Select/Select.test.js +3 -3
- package/dist/components/Atoms/SocialIcons/Icon/Icon.js +13 -13
- package/dist/components/Atoms/SocialIcons/SocialIcons.js +25 -23
- package/dist/components/Atoms/SocialIcons/SocialIcons.test.js +7 -7
- package/dist/components/Atoms/SocialIcons/Utils/Icons.js +3 -3
- package/dist/components/Atoms/SocialIcons/Utils/Links.js +19 -20
- package/dist/components/Atoms/SocialIcons/assets/X-white-Subtract.svg +3 -0
- package/dist/components/Atoms/Text/Text.js +62 -41
- package/dist/components/Atoms/Text/Text.test.js +11 -11
- package/dist/components/Atoms/TextArea/TextArea.js +18 -17
- package/dist/components/Atoms/TextArea/TextArea.test.js +3 -3
- package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.js +69 -86
- package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.style.js +23 -15
- package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.test.js +15 -19
- package/dist/components/Molecules/Accordion/Accordion.js +35 -32
- package/dist/components/Molecules/Accordion/Accordion.test.js +3 -3
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.js +81 -52
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +5 -5
- package/dist/components/Molecules/Banner/Banner.js +21 -13
- package/dist/components/Molecules/Banner/Banner.test.js +3 -3
- package/dist/components/Molecules/Box/Box.js +33 -27
- package/dist/components/Molecules/Box/Box.test.js +5 -5
- package/dist/components/Molecules/Card/Card.js +22 -22
- package/dist/components/Molecules/Card/Card.test.js +5 -5
- package/dist/components/Molecules/CardDs/CardDs.js +80 -55
- package/dist/components/Molecules/CardDs/CardDs.test.js +3 -3
- package/dist/components/Molecules/Chip/Chip.js +8 -6
- package/dist/components/Molecules/Chip/Chip.style.js +48 -28
- package/dist/components/Molecules/Chip/Chip.test.js +4 -6
- package/dist/components/Molecules/Countdown/Countdown.js +28 -36
- package/dist/components/Molecules/Countdown/Countdown.style.js +3 -3
- package/dist/components/Molecules/Descriptor/Descriptor.js +32 -26
- package/dist/components/Molecules/Descriptor/Descriptor.test.js +5 -5
- package/dist/components/Molecules/DoubleCopy/DoubleCopy.js +6 -4
- package/dist/components/Molecules/DoubleCopy/DoubleCopy.style.js +7 -5
- package/dist/components/Molecules/DoubleCopy/DoubleCopy.test.js +4 -4
- package/dist/components/Molecules/HeroBanner/HeroBanner.js +13 -17
- package/dist/components/Molecules/InfoBanner/InfoBanner.js +22 -18
- package/dist/components/Molecules/InfoBanner/InfoBanner.test.js +10 -10
- package/dist/components/Molecules/Logos/Logos.js +26 -14
- package/dist/components/Molecules/Logos/Logos.md +5 -0
- package/dist/components/Molecules/Lookup/Lookup.js +49 -84
- package/dist/components/Molecules/PartnerLink/PartnerLink.js +10 -11
- package/dist/components/Molecules/PartnerLink/PartnerLink.style.js +15 -9
- package/dist/components/Molecules/PartnerLink/PartnerLink.test.js +3 -3
- package/dist/components/Molecules/Promo/Promo.js +30 -36
- package/dist/components/Molecules/Promo/Promo.style.js +44 -31
- package/dist/components/Molecules/Promo/Promo.test.js +6 -6
- package/dist/components/Molecules/Promo/_ProgressRing.js +13 -19
- package/dist/components/Molecules/Promo/_PromoVideo.js +25 -34
- package/dist/components/Molecules/Promo/_PromoVideoButton.js +7 -7
- package/dist/components/Molecules/Promo/_PromoVideoButton.style.js +68 -41
- package/dist/components/Molecules/SchoolLookup/SchoolLookup.js +29 -52
- package/dist/components/Molecules/SchoolLookup/SchoolLookup.test.js +4 -4
- package/dist/components/Molecules/SearchInput/SearchInput.js +8 -8
- package/dist/components/Molecules/SearchInput/SearchInput.style.js +22 -14
- package/dist/components/Molecules/SearchInput/SearchInput.test.js +4 -4
- package/dist/components/Molecules/SearchResult/SearchResult.js +43 -29
- package/dist/components/Molecules/SearchResult/SearchResult.test.js +9 -9
- package/dist/components/Molecules/ShareButton/ShareButton.js +22 -26
- package/dist/components/Molecules/ShareButton/ShareButton.style.js +5 -5
- package/dist/components/Molecules/ShareButton/ShareButton.test.js +3 -3
- package/dist/components/Molecules/ShareButton/assets/ShareIcons.js +2 -2
- package/dist/components/Molecules/SimpleSchoolLookup/SimpleSchoolLookup.js +28 -55
- package/dist/components/Molecules/SingleMessage/SingleMessage.js +99 -123
- package/dist/components/Molecules/SingleMessage/SingleMessage.style.js +132 -81
- package/dist/components/Molecules/SingleMessage/SingleMessage.test.js +13 -13
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.js +31 -40
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.style.js +85 -49
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.test.js +3 -3
- package/dist/components/Molecules/Typeahead/Typeahead.js +47 -84
- package/dist/components/Molecules/Typeahead/Typeahead.test.js +12 -35
- package/dist/components/Molecules/VideoBanner/VideoBanner.js +20 -25
- package/dist/components/Molecules/VideoBanner/VideoBanner.test.js +4 -4
- package/dist/components/Organisms/CookieBanner/CookieBanner.js +7 -5
- package/dist/components/Organisms/CookieBanner/CookieBanner.style.js +21 -13
- package/dist/components/Organisms/CookieBanner/CookieBanner.test.js +5 -5
- package/dist/components/Organisms/Donate/Donate.js +34 -37
- package/dist/components/Organisms/Donate/Donate.style.js +85 -53
- package/dist/components/Organisms/Donate/Donate.test.js +10 -10
- package/dist/components/Organisms/Donate/Form/Form.js +53 -78
- package/dist/components/Organisms/Donate/Form/PopUpComponent.js +25 -30
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.js +11 -13
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.style.js +38 -22
- package/dist/components/Organisms/Donate/MoneyBuy/MoneyBuy.js +47 -30
- package/dist/components/Organisms/EmailSignUp/EmailSignUp.style.js +63 -37
- package/dist/components/Organisms/EmailSignUp/EmailSignUp.test.js +12 -12
- package/dist/components/Organisms/EmailSignUp/EmailSignUpForm.js +23 -43
- package/dist/components/Organisms/EmailSignUp/_EmailSignUp.js +25 -21
- package/dist/components/Organisms/EmailSignUp/_EmailSignUpConfig.js +10 -9
- package/dist/components/Organisms/EmailSignUp/_TextInput.js +20 -18
- package/dist/components/Organisms/Footer/Footer.js +10 -10
- package/dist/components/Organisms/Footer/Footer.style.js +27 -21
- package/dist/components/Organisms/Footer/Footer.test.js +3 -3
- package/dist/components/Organisms/Footer/Nav/Nav.js +59 -70
- package/dist/components/Organisms/Footer/Nav/Nav.style.js +77 -43
- package/dist/components/Organisms/Header/Burger/BurgerMenu.js +6 -4
- package/dist/components/Organisms/Header/Burger/BurgerMenu.style.js +37 -21
- package/dist/components/Organisms/Header/Header.js +8 -8
- package/dist/components/Organisms/Header/Header.style.js +27 -19
- package/dist/components/Organisms/Header/Nav/Nav.js +39 -50
- package/dist/components/Organisms/Header/Nav/Nav.style.js +103 -57
- package/dist/components/Organisms/Header/header.test.js +1 -1
- package/dist/components/Organisms/ImpactSlider/ImpactMoneybuys.style.js +32 -29
- package/dist/components/Organisms/ImpactSlider/ImpactSlider.js +19 -22
- package/dist/components/Organisms/ImpactSlider/ImpactSlider.style.js +38 -24
- package/dist/components/Organisms/ImpactSlider/Slider.style.js +8 -14
- package/dist/components/Organisms/ImpactSlider/_ImpactMoneybuys.js +11 -11
- package/dist/components/Organisms/ImpactSlider/_Slider.js +9 -7
- package/dist/components/Organisms/ImpactSlider/_utils.js +11 -11
- package/dist/components/Organisms/MarketingPreferencesDS/MarketingPreferencesDS.style.js +61 -38
- package/dist/components/Organisms/MarketingPreferencesDS/MarketingPreferencesDSForm.js +24 -16
- package/dist/components/Organisms/MarketingPreferencesDS/_AssociatedFields.js +1 -1
- package/dist/components/Organisms/MarketingPreferencesDS/_CheckAnswer.js +20 -16
- package/dist/components/Organisms/MarketingPreferencesDS/_DefaultCopy.js +3 -3
- package/dist/components/Organisms/MarketingPreferencesDS/_MarketingPreferencesDS.js +46 -36
- package/dist/components/Organisms/MarketingPreferencesDS/_MarketingPrefsConfig.js +21 -34
- package/dist/components/Organisms/MarketingPreferencesDS/_TextInput.js +20 -18
- package/dist/components/Organisms/Membership/Form/Form.js +48 -81
- package/dist/components/Organisms/Membership/Membership.js +17 -15
- package/dist/components/Organisms/Membership/Membership.style.js +81 -51
- package/dist/components/Organisms/Membership/Membership.test.js +4 -4
- package/dist/components/Organisms/Membership/MoneyBox/MoneyBox.js +37 -26
- package/dist/hoc/shallowWithTheme.js +1 -1
- package/dist/index.js +67 -67
- package/dist/styleguide/CRLogo.js +2 -2
- package/dist/styleguide/StyleGuideRenderer.js +9 -7
- package/dist/styleguide/ThemeWrapper.js +5 -3
- package/dist/styleguide/data/data.js +3 -3
- package/dist/theme/crTheme/buttonColors.js +6 -5
- package/dist/theme/crTheme/colors.js +4 -3
- package/dist/theme/crTheme/fontSizes.js +4 -3
- package/dist/theme/crTheme/linkStyles.js +6 -5
- package/dist/theme/crTheme/theme.js +1 -1
- package/dist/theme/shared/breakpoint.js +4 -3
- package/dist/theme/shared/fontFamilies.js +5 -4
- package/dist/theme/shared/hideVisually.js +1 -1
- package/dist/theme/shared/size.js +4 -3
- package/dist/theme/shared/spacing.js +2 -2
- package/dist/theme/shared/zIndex.js +3 -3
- package/dist/theme/srTheme/buttonColors.js +6 -5
- package/dist/theme/srTheme/colors.js +4 -3
- package/dist/theme/srTheme/fontSizes.js +4 -3
- package/dist/theme/srTheme/linkStyles.js +6 -5
- package/dist/theme/srTheme/theme.js +1 -1
- package/dist/utils/Membership.js +30 -27
- package/dist/utils/ShareButton/sharePopUpHelper.js +8 -8
- package/dist/utils/ShareButton/shareTracking.js +1 -1
- package/dist/utils/ShareButton/shareUrlHelper.js +3 -3
- package/dist/utils/allowListed.js +3 -5
- package/dist/utils/allowListed.test.js +3 -3
- package/dist/utils/internalLinkHelper.js +8 -10
- package/dist/utils/navHelper.js +2 -2
- package/package.json +12 -9
- package/playwright/components/atoms/checkbox.spec.js +64 -0
- package/playwright/components/atoms/input.spec.js +158 -0
- package/playwright/components/atoms/label.spec.js +29 -0
- package/playwright/components/atoms/link.spec.js +48 -0
- package/playwright/components/atoms/radioButton.spec.js +30 -0
- package/playwright/components/atoms/select.spec.js +36 -0
- package/playwright/components/atoms/textArea.spec.js +39 -0
- package/playwright/components/atoms/textInputWithDropdown.spec.js +23 -0
- package/playwright/components/molecules/accordian.spec.js +20 -0
- package/playwright/components/molecules/schoolLookup.spec.js +26 -0
- package/playwright/components/molecules/searchInput.spec.js +24 -0
- package/playwright/components/molecules/shareButton.spec.js +32 -0
- package/playwright/components/molecules/simpleSchoolLookUp.spec.js +35 -0
- package/playwright/components/molecules/typeahead.spec.js +27 -0
- package/playwright/components/organisms/donate.spec.js +293 -0
- package/playwright/components/organisms/emailSignUpForm.spec.js +109 -0
- package/playwright/components/organisms/footer.spec.js +67 -0
- package/playwright/components/organisms/header.spec.js +82 -0
- package/playwright/components/organisms/impactSlider.spec.js +292 -0
- package/playwright/components/organisms/marketingPreferences.spec.js +220 -0
- package/playwright/components/organisms/membership.spec.js +47 -0
- package/playwright.config.js +49 -0
- package/src/components/Atoms/SocialIcons/Utils/Icons.js +1 -1
- package/src/components/Atoms/SocialIcons/assets/X-white-Subtract.svg +3 -0
- package/src/components/Molecules/Logos/Logos.js +18 -6
- package/src/components/Molecules/Logos/Logos.md +5 -0
- package/src/components/Organisms/ImpactSlider/_ImpactMoneybuys.js +3 -4
- package/src/components/Organisms/Membership/Membership.test.js +1 -1
- package/cypress/e2e/components/atoms/button.cy.js +0 -102
- package/cypress/e2e/components/atoms/buttonWithStates.cy.js +0 -47
- package/cypress/e2e/components/atoms/checkbox.cy.js +0 -70
- package/cypress/e2e/components/atoms/confetti.cy.js +0 -46
- package/cypress/e2e/components/atoms/errorText.cy.js +0 -45
- package/cypress/e2e/components/atoms/input.cy.js +0 -157
- package/cypress/e2e/components/atoms/label.cy.js +0 -93
- package/cypress/e2e/components/atoms/link.cy.js +0 -190
- package/cypress/e2e/components/atoms/logo.cy.js +0 -132
- package/cypress/e2e/components/atoms/pagination.cy.js +0 -191
- package/cypress/e2e/components/atoms/picture.cy.js +0 -130
- package/cypress/e2e/components/atoms/radioButton.cy.js +0 -76
- package/cypress/e2e/components/atoms/richText.cy.js +0 -70
- package/cypress/e2e/components/atoms/select.cy.js +0 -84
- package/cypress/e2e/components/atoms/socialIcons.cy.js +0 -162
- package/cypress/e2e/components/atoms/text.cy.js +0 -169
- package/cypress/e2e/components/atoms/textArea.cy.js +0 -89
- package/cypress/e2e/components/atoms/textInputWithDrop.cy.js +0 -76
- package/cypress/e2e/components/molecules/accordion.cy.js +0 -67
- package/cypress/e2e/components/molecules/articleTeaser.cy.js +0 -105
- package/cypress/e2e/components/molecules/banner.cy.js +0 -67
- package/cypress/e2e/components/molecules/box.cy.js +0 -104
- package/cypress/e2e/components/molecules/card.cy.js +0 -105
- package/cypress/e2e/components/molecules/cardDs.cy.js +0 -198
- package/cypress/e2e/components/molecules/chip.cy.js +0 -68
- package/cypress/e2e/components/molecules/countdown.cy.js +0 -71
- package/cypress/e2e/components/molecules/descriptor.cy.js +0 -142
- package/cypress/e2e/components/molecules/doubleCopy.cy.js +0 -79
- package/cypress/e2e/components/molecules/heroBanner.cy.js +0 -69
- package/cypress/e2e/components/molecules/infoBanner.cy.js +0 -69
- package/cypress/e2e/components/molecules/partnerLink.cy.js +0 -68
- package/cypress/e2e/components/molecules/promo.cy.js +0 -74
- package/cypress/e2e/components/molecules/schoolLookup.cy.js +0 -83
- package/cypress/e2e/components/molecules/searchInput.cy.js +0 -72
- package/cypress/e2e/components/molecules/searchResult.cy.js +0 -191
- package/cypress/e2e/components/molecules/shareButton.cy.js +0 -76
- package/cypress/e2e/components/molecules/simpleSchoolLookup.cy.js +0 -83
- package/cypress/e2e/components/molecules/singleMessage.cy.js +0 -502
- package/cypress/e2e/components/molecules/singleMessageDs.cy.js +0 -234
- package/cypress/e2e/components/molecules/typeahead.cy.js +0 -97
- package/cypress/e2e/components/molecules/videoBanner.cy.js +0 -132
- package/cypress/e2e/components/organisms/cookieBanner.cy.js +0 -80
- package/cypress/e2e/components/organisms/donate.cy.js +0 -284
- package/cypress/e2e/components/organisms/emailSignUp.cy.js +0 -54
- package/cypress/e2e/components/organisms/footer.cy.js +0 -168
- package/cypress/e2e/components/organisms/header.cy.js +0 -138
- package/cypress/e2e/components/organisms/impactSlider.cy.js +0 -72
- package/cypress/e2e/components/organisms/marketingPreferencesDSForm.cy.js +0 -589
- package/cypress/e2e/components/organisms/membership.cy.js +0 -122
- package/cypress/fixtures/example.json +0 -5
- package/cypress/plugins/index.js +0 -21
- package/cypress/support/commands.js +0 -25
- package/cypress/support/e2e.js +0 -36
- package/cypress.config.js +0 -15
- package/dist/components/Atoms/SocialIcons/assets/x-logo.svg +0 -3
- package/src/components/Atoms/SocialIcons/assets/x-logo.svg +0 -3
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
describe('Text Input With Dropdown component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to textinputwithdropdown component
|
|
4
|
-
cy.visit('/#textinputwithdropdown');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
describe('props and methods section', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
cy.visit('/#textinputwithdropdown');
|
|
10
|
-
cy.get('[data-testid="TextInputWithDropdown-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('TextInputWithDropdown section', () => {
|
|
38
|
-
beforeEach(() => {
|
|
39
|
-
cy.visit('/#textinputwithdropdown');
|
|
40
|
-
cy.get('[data-testid="TextInputWithDropdown-examples"]')
|
|
41
|
-
.as('container')
|
|
42
|
-
.find('[data-preview="TextInputWithDropdown"]')
|
|
43
|
-
.as('preview');
|
|
44
|
-
|
|
45
|
-
cy.get('@container')
|
|
46
|
-
.find('button')
|
|
47
|
-
.contains('View Code')
|
|
48
|
-
.as('viewCodeBtn');
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('renders text input with dropdown field section', () => {
|
|
52
|
-
cy.get('@container')
|
|
53
|
-
.find('h1')
|
|
54
|
-
.should('exist')
|
|
55
|
-
.contains('TextInputWithDropdown');
|
|
56
|
-
cy.get('@container')
|
|
57
|
-
.find('#input-with-dropdown')
|
|
58
|
-
.should('exist')
|
|
59
|
-
.type('This is a test text');
|
|
60
|
-
cy.get('@container')
|
|
61
|
-
.find('ul > li:nth-child(2)') // first option
|
|
62
|
-
.click();
|
|
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,67 +0,0 @@
|
|
|
1
|
-
describe('Accordion component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to accordion component
|
|
4
|
-
cy.visit('/#accordion');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
describe('props and methods section', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
cy.visit('/#accordion');
|
|
10
|
-
cy.get('[data-testid="Accordion-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('Accordion section', () => {
|
|
38
|
-
beforeEach(() => {
|
|
39
|
-
cy.visit('/#accordion');
|
|
40
|
-
cy.get('[data-testid="Accordion-example-1"]')
|
|
41
|
-
.as('container')
|
|
42
|
-
.find('[data-preview="Accordion"]')
|
|
43
|
-
.as('preview');
|
|
44
|
-
|
|
45
|
-
cy.get('@container')
|
|
46
|
-
.find('button')
|
|
47
|
-
.contains('View Code')
|
|
48
|
-
.as('viewCodeBtn');
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('clicking svg dropdown icon should element p', () => {
|
|
52
|
-
cy.get('[data-testid="Accordion-example-1"] button > div').click();
|
|
53
|
-
cy.get('p').should('exist');
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it('has view code button', () => {
|
|
57
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it('shows code on click', () => {
|
|
61
|
-
cy.get('@viewCodeBtn').click();
|
|
62
|
-
cy.get('@container')
|
|
63
|
-
.find('textarea')
|
|
64
|
-
.should('exist');
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
});
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
describe('ArticleTeaser component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to articleteaser component
|
|
4
|
-
cy.visit('/#articleteaser');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
describe('props and methods section', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
cy.visit('/#articleteaser');
|
|
10
|
-
cy.get('[data-testid="ArticleTeaser-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('Article Teaser section', () => {
|
|
38
|
-
beforeEach(() => {
|
|
39
|
-
cy.visit('/#articleteaser');
|
|
40
|
-
cy.get('[data-testid="ArticleTeaser-example-1"]')
|
|
41
|
-
.as('container')
|
|
42
|
-
.find('[data-preview="ArticleTeaser"]')
|
|
43
|
-
.as('preview');
|
|
44
|
-
|
|
45
|
-
cy.get('@container')
|
|
46
|
-
.find('button')
|
|
47
|
-
.contains('View Code')
|
|
48
|
-
.as('viewCodeBtn');
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
//ArticleTeaser 1
|
|
52
|
-
it('renders article teaser', () => {
|
|
53
|
-
cy.get('@container')
|
|
54
|
-
.find('span')
|
|
55
|
-
.should('exist')
|
|
56
|
-
.contains(' 01 July 2019');
|
|
57
|
-
cy.get('@container')
|
|
58
|
-
.find('h3')
|
|
59
|
-
.should('exist')
|
|
60
|
-
.contains('News article');
|
|
61
|
-
cy.get('@container')
|
|
62
|
-
.find('span')
|
|
63
|
-
.should('exist')
|
|
64
|
-
.contains('4 min read');
|
|
65
|
-
|
|
66
|
-
//article teaser 2
|
|
67
|
-
cy.get('@container')
|
|
68
|
-
.find('div:nth-child(2) > article > a')
|
|
69
|
-
.as('container2')
|
|
70
|
-
.should('exist')
|
|
71
|
-
.contains('01 July 2019');
|
|
72
|
-
cy.get('@container2')
|
|
73
|
-
.find('h3')
|
|
74
|
-
.should('exist')
|
|
75
|
-
.contains('News article News article');
|
|
76
|
-
cy.get('@container2')
|
|
77
|
-
.find('span')
|
|
78
|
-
.should('exist')
|
|
79
|
-
.contains('4 min read');
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
//ArticleTeaser: Press Release
|
|
83
|
-
it('renders article teaser : press release', () => {
|
|
84
|
-
cy.get('[data-testid="ArticleTeaser-example-3"]')
|
|
85
|
-
.find('span')
|
|
86
|
-
.should('exist')
|
|
87
|
-
.contains('01 July 2019');
|
|
88
|
-
cy.get('[data-testid="ArticleTeaser-example-3"]')
|
|
89
|
-
.find('h3')
|
|
90
|
-
.should('exist')
|
|
91
|
-
.contains('Press Release');
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('has view code button', () => {
|
|
95
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
it('shows code on click', () => {
|
|
99
|
-
cy.get('@viewCodeBtn').click();
|
|
100
|
-
cy.get('@container')
|
|
101
|
-
.find('textarea')
|
|
102
|
-
.should('exist');
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
});
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
describe('Banner component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to banner component
|
|
4
|
-
cy.visit('/#banner');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
describe('props and methods section', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
cy.visit('/#banner');
|
|
10
|
-
cy.get('[data-testid="Banner-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('Banner section', () => {
|
|
38
|
-
beforeEach(() => {
|
|
39
|
-
cy.visit('/#banner');
|
|
40
|
-
cy.get('[data-testid="Banner-example-1"]')
|
|
41
|
-
.as('container')
|
|
42
|
-
.find('[data-preview="Banner"]')
|
|
43
|
-
.as('preview');
|
|
44
|
-
|
|
45
|
-
cy.get('@container')
|
|
46
|
-
.find('button')
|
|
47
|
-
.contains('View Code')
|
|
48
|
-
.as('viewCodeBtn');
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('should show element p with text', () => {
|
|
52
|
-
cy.get('@container')
|
|
53
|
-
.find('p').should('exist');
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it('has view code button', () => {
|
|
57
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it('shows code on click', () => {
|
|
61
|
-
cy.get('@viewCodeBtn').click();
|
|
62
|
-
cy.get('@container')
|
|
63
|
-
.find('textarea')
|
|
64
|
-
.should('exist');
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
});
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
describe('Box component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to box component
|
|
4
|
-
cy.visit('/#box');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
describe('props and methods section', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
cy.visit('/#box');
|
|
10
|
-
cy.get('[data-testid="Box-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('Box example 1 section', () => {
|
|
38
|
-
beforeEach(() => {
|
|
39
|
-
cy.visit('/#box');
|
|
40
|
-
cy.get('[data-testid="Box-example-1"]')
|
|
41
|
-
.as('container')
|
|
42
|
-
.find('[data-preview="Box"]')
|
|
43
|
-
.as('preview');
|
|
44
|
-
|
|
45
|
-
cy.get('@container')
|
|
46
|
-
.find('button')
|
|
47
|
-
.contains('View Code')
|
|
48
|
-
.as('viewCodeBtn');
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('renders box preview', () => {
|
|
52
|
-
cy.get('@container')
|
|
53
|
-
.find('h3')
|
|
54
|
-
.should('exist')
|
|
55
|
-
.contains('Title');
|
|
56
|
-
cy.get('@container')
|
|
57
|
-
.find('p')
|
|
58
|
-
.should('exist')
|
|
59
|
-
.contains('Text body copy description');
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('has view code button', () => {
|
|
63
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('shows code on click', () => {
|
|
67
|
-
cy.get('@viewCodeBtn').click();
|
|
68
|
-
cy.get('@container')
|
|
69
|
-
.find('textarea')
|
|
70
|
-
.should('exist');
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
describe('Box example 3 section', () => {
|
|
75
|
-
beforeEach(() => {
|
|
76
|
-
cy.visit('/#box');
|
|
77
|
-
cy.get('[data-testid="Box-example-3"]')
|
|
78
|
-
.as('container')
|
|
79
|
-
.find('[data-preview="Box"]')
|
|
80
|
-
.as('preview');
|
|
81
|
-
|
|
82
|
-
cy.get('@container')
|
|
83
|
-
.find('button')
|
|
84
|
-
.contains('View Code')
|
|
85
|
-
.as('viewCodeBtn');
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it('renders box preview', () => {
|
|
89
|
-
cy.get('@container')
|
|
90
|
-
.should('exist');
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it('has view code button', () => {
|
|
94
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it('shows code on click', () => {
|
|
98
|
-
cy.get('@viewCodeBtn').click();
|
|
99
|
-
cy.get('@container')
|
|
100
|
-
.find('textarea')
|
|
101
|
-
.should('exist');
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
});
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
describe('Card component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to card component
|
|
4
|
-
cy.visit('/#card');
|
|
5
|
-
cy.wait(2500)
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
describe('props and methods section', () => {
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
cy.visit('/#card');
|
|
11
|
-
cy.get('[data-testid="Card-container"] button[name="rsg-usage"]')
|
|
12
|
-
.contains('Props & methods')
|
|
13
|
-
.as('propsBtn');
|
|
14
|
-
|
|
15
|
-
cy.get('@propsBtn')
|
|
16
|
-
.closest('[class^=rsg--tabs]')
|
|
17
|
-
.as('container');
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('is present', () => {
|
|
21
|
-
cy.get('@propsBtn').should('exist');
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('does not show table initially', () => {
|
|
25
|
-
cy.get('@container')
|
|
26
|
-
.find('table')
|
|
27
|
-
.should('not.exist');
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('shows the table on button click', () => {
|
|
31
|
-
cy.get('@propsBtn').click();
|
|
32
|
-
cy.get('@container')
|
|
33
|
-
.find('table')
|
|
34
|
-
.should('contain', 'Prop name');
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
describe('Card example 1 section', () => {
|
|
39
|
-
beforeEach(() => {
|
|
40
|
-
cy.visit('/#card');
|
|
41
|
-
cy.get('[data-testid="Card-example-1"]')
|
|
42
|
-
.as('container')
|
|
43
|
-
.find('[data-preview="Card"]')
|
|
44
|
-
.as('preview');
|
|
45
|
-
|
|
46
|
-
cy.get('@container')
|
|
47
|
-
.find('button')
|
|
48
|
-
.contains('View Code')
|
|
49
|
-
.as('viewCodeBtn');
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('renders card preview', () => {
|
|
53
|
-
cy.get('@container')
|
|
54
|
-
.find('h3')
|
|
55
|
-
.should('exist')
|
|
56
|
-
.contains('Title');
|
|
57
|
-
cy.get('@container')
|
|
58
|
-
.find('p')
|
|
59
|
-
.should('exist')
|
|
60
|
-
.contains('Text body copy description');
|
|
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
|
-
|
|
75
|
-
describe('Card no body section', () => {
|
|
76
|
-
beforeEach(() => {
|
|
77
|
-
cy.visit('/#card');
|
|
78
|
-
cy.get('[data-testid="Card-example-3"]')
|
|
79
|
-
.as('container')
|
|
80
|
-
.find('[data-preview="Card"]')
|
|
81
|
-
.as('preview');
|
|
82
|
-
|
|
83
|
-
cy.get('@container')
|
|
84
|
-
.find('button')
|
|
85
|
-
.contains('View Code')
|
|
86
|
-
.as('viewCodeBtn');
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it('renders card no body preview', () => {
|
|
90
|
-
cy.get('@container')
|
|
91
|
-
.should('exist');
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('has view code button', () => {
|
|
95
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
it('shows code on click', () => {
|
|
99
|
-
cy.get('@viewCodeBtn').click();
|
|
100
|
-
cy.get('@container')
|
|
101
|
-
.find('textarea')
|
|
102
|
-
.should('exist');
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
});
|