@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,190 +0,0 @@
|
|
|
1
|
-
describe('Link component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to link component
|
|
4
|
-
cy.visit('/#link');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
describe('props and methods section', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
cy.visit('/#link');
|
|
10
|
-
cy.get('[data-testid="Link-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('Link standard preview section', () => {
|
|
38
|
-
beforeEach(() => {
|
|
39
|
-
cy.visit('/#link');
|
|
40
|
-
cy.get('[data-testid="Link-example-0"]')
|
|
41
|
-
.as('container')
|
|
42
|
-
.find('[data-preview="Link"]')
|
|
43
|
-
.as('preview');
|
|
44
|
-
|
|
45
|
-
cy.get('@container')
|
|
46
|
-
.find('button')
|
|
47
|
-
.contains('View Code')
|
|
48
|
-
.as('viewCodeBtn');
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('renders link standard section', () => {
|
|
52
|
-
cy.get('[data-testid="Link-example-0"]')
|
|
53
|
-
.should('exist');
|
|
54
|
-
|
|
55
|
-
cy.get('[data-testid="Link-example-0"]')
|
|
56
|
-
.first()
|
|
57
|
-
.contains('Link standard')
|
|
58
|
-
.should('exist');
|
|
59
|
-
cy.get('[data-testid="Link-example-0"] div > div:nth-child(2) > a')
|
|
60
|
-
.contains('Link standard icon')
|
|
61
|
-
.should('exist');
|
|
62
|
-
cy.get('[data-testid="Link-example-0"] div > div:nth-child(2) > a > span > svg')
|
|
63
|
-
.should('exist');
|
|
64
|
-
cy.get('[data-testid="Link-example-0"] div > div:nth-child(3) > a')
|
|
65
|
-
.contains('Link standard white')
|
|
66
|
-
.should('exist')
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it('has view code button', () => {
|
|
70
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
it('shows code on click', () => {
|
|
74
|
-
cy.get('@viewCodeBtn').click();
|
|
75
|
-
cy.get('@container')
|
|
76
|
-
.find('textarea')
|
|
77
|
-
.should('exist');
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
describe('Iconography section', () => {
|
|
82
|
-
beforeEach(() => {
|
|
83
|
-
cy.visit('/#link');
|
|
84
|
-
cy.get('[data-testid="Link-example-2"]')
|
|
85
|
-
.as('container')
|
|
86
|
-
.find('[data-preview="Link"]')
|
|
87
|
-
.as('preview');
|
|
88
|
-
|
|
89
|
-
cy.get('@container')
|
|
90
|
-
.find('button')
|
|
91
|
-
.contains('View Code')
|
|
92
|
-
.as('viewCodeBtn');
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
it('renders link Iconography section', () => {
|
|
96
|
-
cy.get('[data-testid="Link-example-2"]')
|
|
97
|
-
.should('exist');
|
|
98
|
-
|
|
99
|
-
cy.get('[data-testid="Link-example-2"]')
|
|
100
|
-
.first()
|
|
101
|
-
.contains('Internal link')
|
|
102
|
-
.should('exist');
|
|
103
|
-
cy.get('[data-testid="Link-example-2"] div > div:nth-child(2) > a')
|
|
104
|
-
.contains('External link')
|
|
105
|
-
.should('exist');
|
|
106
|
-
//check icon exist
|
|
107
|
-
cy.get('[data-testid="Link-example-2"] div > div:nth-child(2) > a > span > svg')
|
|
108
|
-
.should('exist');
|
|
109
|
-
cy.get('[data-testid="Link-example-2"] div > div:nth-child(3) > a')
|
|
110
|
-
.contains('Download link')
|
|
111
|
-
.should('exist');
|
|
112
|
-
//check icon exist
|
|
113
|
-
cy.get('[data-testid="Link-example-2"] div > div:nth-child(3) > a > span > svg')
|
|
114
|
-
.should('exist');
|
|
115
|
-
cy.get('[data-testid="Link-example-2"] div > div:nth-child(4) > a')
|
|
116
|
-
.contains('Favourite link')
|
|
117
|
-
.should('exist');
|
|
118
|
-
//check icon exist
|
|
119
|
-
cy.get('[data-testid="Link-example-2"] div > div:nth-child(4) > a > span > svg')
|
|
120
|
-
.should('exist');
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
it('has view code button', () => {
|
|
124
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
it('shows code on click', () => {
|
|
128
|
-
cy.get('@viewCodeBtn').click();
|
|
129
|
-
cy.get('@container')
|
|
130
|
-
.find('textarea')
|
|
131
|
-
.should('exist');
|
|
132
|
-
});
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
describe('Link as button section', () => {
|
|
136
|
-
beforeEach(() => {
|
|
137
|
-
cy.visit('/#link');
|
|
138
|
-
cy.get('[data-testid="Link-example-3"]')
|
|
139
|
-
.as('container')
|
|
140
|
-
.find('[data-preview="Link"]')
|
|
141
|
-
.as('preview');
|
|
142
|
-
|
|
143
|
-
cy.get('@container')
|
|
144
|
-
.find('button')
|
|
145
|
-
.contains('View Code')
|
|
146
|
-
.as('viewCodeBtn');
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
it('renders link as buttons section', () => {
|
|
150
|
-
cy.get('[data-testid="Link-example-3"]')
|
|
151
|
-
.should('exist');
|
|
152
|
-
|
|
153
|
-
//verify all button colors
|
|
154
|
-
cy.get('[data-testid="Link-example-3"] div > div:nth-child(1) > a[color="black"]')
|
|
155
|
-
.contains('Link as button')
|
|
156
|
-
.should('exist');
|
|
157
|
-
cy.get('[data-testid="Link-example-3"] div > div:nth-child(2) > a[color="red"]')
|
|
158
|
-
.contains('Link as button')
|
|
159
|
-
.and('exist');
|
|
160
|
-
cy.get('[data-testid="Link-example-3"] div > div:nth-child(3) > a[color="yellow"]')
|
|
161
|
-
.should('exist');
|
|
162
|
-
cy.get('[data-testid="Link-example-3"] div > div:nth-child(4) > a[color="yellow_light"]')
|
|
163
|
-
.contains('Link as button')
|
|
164
|
-
.should('exist');
|
|
165
|
-
cy.get('[data-testid="Link-example-3"] div > div:nth-child(5) > a[color="yellow_dark"]')
|
|
166
|
-
.contains('Link as button')
|
|
167
|
-
.should('exist');
|
|
168
|
-
cy.get('[data-testid="Link-example-3"] div:nth-child(6) > div:nth-child(1) > a[color="grey"] ')
|
|
169
|
-
.contains('Link as button')
|
|
170
|
-
.should('exist');
|
|
171
|
-
cy.get('[data-testid="Link-example-3"] div > div > div:nth-child(6) > a[color="transparent"]')
|
|
172
|
-
.contains('Link as transparent button')
|
|
173
|
-
.should('exist');
|
|
174
|
-
cy.get('[data-testid="Link-example-3"] div:nth-child(3) > a[color="white"]')
|
|
175
|
-
.contains('White button')
|
|
176
|
-
.should('exist');
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
it('has view code button', () => {
|
|
180
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
it('shows code on click', () => {
|
|
184
|
-
cy.get('@viewCodeBtn').click();
|
|
185
|
-
cy.get('@container')
|
|
186
|
-
.find('textarea')
|
|
187
|
-
.should('exist');
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
});
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
describe('Logo component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to logo component
|
|
4
|
-
cy.visit('/#logo');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
describe('props and methods section', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
cy.visit('/#logo');
|
|
10
|
-
cy.get('[data-testid="Logo-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('CR logo section', () => {
|
|
38
|
-
beforeEach(() => {
|
|
39
|
-
cy.visit('/#logo');
|
|
40
|
-
cy.get('[data-testid="Logo-example-1"]')
|
|
41
|
-
.as('container')
|
|
42
|
-
.find('[data-preview="Logo"]')
|
|
43
|
-
.as('preview');
|
|
44
|
-
|
|
45
|
-
cy.get('@container')
|
|
46
|
-
.find('button')
|
|
47
|
-
.contains('View Code')
|
|
48
|
-
.as('viewCodeBtn');
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('should check CR logo', () => {
|
|
52
|
-
cy.get('[data-testid="Logo-examples"] h1[id="comic-relief-logo"]')
|
|
53
|
-
.should('exist')
|
|
54
|
-
.contains('Comic Relief Logo')
|
|
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
|
-
|
|
69
|
-
describe('SR logo section', () => {
|
|
70
|
-
beforeEach(() => {
|
|
71
|
-
cy.visit('/#logo');
|
|
72
|
-
cy.get('[data-testid="Logo-example-3"]')
|
|
73
|
-
.as('container')
|
|
74
|
-
.find('[data-preview="Logo"]')
|
|
75
|
-
.as('preview');
|
|
76
|
-
|
|
77
|
-
cy.get('@container')
|
|
78
|
-
.find('button')
|
|
79
|
-
.contains('View Code')
|
|
80
|
-
.as('viewCodeBtn');
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('should check SR logo', () => {
|
|
84
|
-
cy.get('[data-testid="Logo-examples"] h1[id="sport-relief-logo"]')
|
|
85
|
-
.should('exist')
|
|
86
|
-
.contains('Sport Relief Logo')
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it('has view code button', () => {
|
|
90
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it('shows code on click', () => {
|
|
94
|
-
cy.get('@viewCodeBtn').click();
|
|
95
|
-
cy.get('@container')
|
|
96
|
-
.find('textarea')
|
|
97
|
-
.should('exist');
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
describe('SR game on logo section', () => {
|
|
102
|
-
beforeEach(() => {
|
|
103
|
-
cy.visit('/#logo');
|
|
104
|
-
cy.get('[data-testid="Logo-example-5"]')
|
|
105
|
-
.as('container')
|
|
106
|
-
.find('[data-preview="Logo"]')
|
|
107
|
-
.as('preview');
|
|
108
|
-
|
|
109
|
-
cy.get('@container')
|
|
110
|
-
.find('button')
|
|
111
|
-
.contains('View Code')
|
|
112
|
-
.as('viewCodeBtn');
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
it('should check SR game on logo', () => {
|
|
116
|
-
cy.get('[data-testid="Logo-examples"] h1[id="sport-relief-game-on-logo"]')
|
|
117
|
-
.should('exist')
|
|
118
|
-
.contains('Sport Relief Game On Logo');
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it('has view code button', () => {
|
|
122
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it('shows code on click', () => {
|
|
126
|
-
cy.get('@viewCodeBtn').click();
|
|
127
|
-
cy.get('@container')
|
|
128
|
-
.find('textarea')
|
|
129
|
-
.should('exist');
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
});
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
describe('Pagination component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to pagination component
|
|
4
|
-
cy.visit('/#pagination');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
describe('props and methods section', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
cy.visit('/#pagination');
|
|
10
|
-
cy.get('[data-testid="Pagination-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('Pagination minimalist section', () => {
|
|
38
|
-
beforeEach(() => {
|
|
39
|
-
cy.visit('/#pagination');
|
|
40
|
-
cy.get('[data-testid="Pagination-example-1"]')
|
|
41
|
-
.as('container')
|
|
42
|
-
.find('[data-preview="Pagination"]')
|
|
43
|
-
.as('preview');
|
|
44
|
-
|
|
45
|
-
cy.get('@container')
|
|
46
|
-
.find('button')
|
|
47
|
-
.contains('View Code')
|
|
48
|
-
.as('viewCodeBtn');
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('should check minimalist section', () => {
|
|
52
|
-
cy.get('[data-testid="Pagination-example-1"]')
|
|
53
|
-
.should('exist');
|
|
54
|
-
cy.get('[data-testid="Pagination-example-1"] ul')
|
|
55
|
-
.should('exist');
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('has view code button', () => {
|
|
59
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('shows code on click', () => {
|
|
63
|
-
cy.get('@viewCodeBtn').click();
|
|
64
|
-
cy.get('@container')
|
|
65
|
-
.find('textarea')
|
|
66
|
-
.should('exist');
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
describe('Pagination full size section', () => {
|
|
71
|
-
beforeEach(() => {
|
|
72
|
-
cy.visit('/#pagination');
|
|
73
|
-
cy.get('[data-testid="Pagination-example-3"]')
|
|
74
|
-
.as('container')
|
|
75
|
-
.find('[data-preview="Pagination"]')
|
|
76
|
-
.as('preview');
|
|
77
|
-
|
|
78
|
-
cy.get('@container')
|
|
79
|
-
.find('button')
|
|
80
|
-
.contains('View Code')
|
|
81
|
-
.as('viewCodeBtn');
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it('verifies full size pagination', () => {
|
|
85
|
-
cy.get('[data-testid="Pagination-example-3"]')
|
|
86
|
-
.should('exist');
|
|
87
|
-
cy.get('[data-testid="Pagination-example-3"] ul')
|
|
88
|
-
.should('exist');
|
|
89
|
-
cy.get('[data-testid="Pagination-example-3"] [aria-label="First page"]')
|
|
90
|
-
.should('exist');
|
|
91
|
-
cy.get('[data-testid="Pagination-example-3"] [aria-label="Previous page"]')
|
|
92
|
-
.should('exist');
|
|
93
|
-
cy.get('[data-testid="Pagination-example-3"] [aria-label="Next page"]')
|
|
94
|
-
.should('exist');
|
|
95
|
-
cy.get('[data-testid="Pagination-example-3"] [aria-label="Last page"]')
|
|
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('Pagination custom style section', () => {
|
|
111
|
-
beforeEach(() => {
|
|
112
|
-
cy.visit('/#pagination');
|
|
113
|
-
cy.get('[data-testid="Pagination-example-5"]')
|
|
114
|
-
.as('container')
|
|
115
|
-
.find('[data-preview="Pagination"]')
|
|
116
|
-
.as('preview');
|
|
117
|
-
|
|
118
|
-
cy.get('@container')
|
|
119
|
-
.find('button')
|
|
120
|
-
.contains('View Code')
|
|
121
|
-
.as('viewCodeBtn');
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
it('should check custom style section exist', () => {
|
|
125
|
-
cy.get('[data-testid="Pagination-example-5"]')
|
|
126
|
-
.should('exist');
|
|
127
|
-
cy.get('[data-testid="Pagination-example-5"] ul')
|
|
128
|
-
.should('exist');
|
|
129
|
-
cy.get('[data-testid="Pagination-example-5"] [aria-label="First page"]')
|
|
130
|
-
.should('exist');
|
|
131
|
-
cy.get('[data-testid="Pagination-example-5"] [aria-label="Previous page"]')
|
|
132
|
-
.should('exist');
|
|
133
|
-
cy.get('[data-testid="Pagination-example-5"] [aria-label="Last page"]')
|
|
134
|
-
.should('exist');
|
|
135
|
-
cy.get('[data-testid="Pagination-example-5"] [aria-label="Next page"]')
|
|
136
|
-
.should('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('Pagination custom labels section', () => {
|
|
152
|
-
beforeEach(() => {
|
|
153
|
-
cy.visit('/#pagination');
|
|
154
|
-
cy.get('[data-testid="Pagination-example-7"]')
|
|
155
|
-
.as('container')
|
|
156
|
-
.find('[data-preview="Pagination"]')
|
|
157
|
-
.as('preview');
|
|
158
|
-
|
|
159
|
-
cy.get('@container')
|
|
160
|
-
.find('button')
|
|
161
|
-
.contains('View Code')
|
|
162
|
-
.as('viewCodeBtn');
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
it('should check custom style section exist', () => {
|
|
166
|
-
cy.get('[data-testid="Pagination-example-7"]')
|
|
167
|
-
.should('exist');
|
|
168
|
-
cy.get('[data-testid="Pagination-example-7"] ul')
|
|
169
|
-
.should('exist');
|
|
170
|
-
cy.get('[data-testid="Pagination-example-7"] [aria-label="First page"]')
|
|
171
|
-
.should('exist');
|
|
172
|
-
cy.get('[data-testid="Pagination-example-7"] [aria-label="Previous page"]')
|
|
173
|
-
.should('exist');
|
|
174
|
-
cy.get('[data-testid="Pagination-example-7"] [aria-label="Last page"]')
|
|
175
|
-
.should('exist');
|
|
176
|
-
cy.get('[data-testid="Pagination-example-7"] [aria-label="Next page"]')
|
|
177
|
-
.should('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,130 +0,0 @@
|
|
|
1
|
-
describe('Picture component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to picture component
|
|
4
|
-
cy.visit('/#picture');
|
|
5
|
-
cy.wait(2500)
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
describe('props and methods section', () => {
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
cy.visit('/#picture');
|
|
11
|
-
cy.get('[data-testid="Picture-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('Picture section', () => {
|
|
39
|
-
beforeEach(() => {
|
|
40
|
-
cy.visit('/#picture');
|
|
41
|
-
cy.get('[data-testid="Picture-example-1"]')
|
|
42
|
-
.as('container')
|
|
43
|
-
.find('[data-preview="Picture"]')
|
|
44
|
-
.as('preview');
|
|
45
|
-
|
|
46
|
-
cy.get('@container')
|
|
47
|
-
.find('button')
|
|
48
|
-
.contains('View Code')
|
|
49
|
-
.as('viewCodeBtn');
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('render picture section', () => {
|
|
53
|
-
cy.get('@container')
|
|
54
|
-
.should('exist')
|
|
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
|
-
|
|
69
|
-
describe('custom size picture section', () => {
|
|
70
|
-
beforeEach(() => {
|
|
71
|
-
cy.visit('/#picture');
|
|
72
|
-
cy.get('[data-testid="Picture-example-3"]')
|
|
73
|
-
.as('container')
|
|
74
|
-
.find('[data-preview="Picture"]')
|
|
75
|
-
.as('preview');
|
|
76
|
-
|
|
77
|
-
cy.get('@container')
|
|
78
|
-
.find('button')
|
|
79
|
-
.contains('View Code')
|
|
80
|
-
.as('viewCodeBtn');
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('should check custom size section', () => {
|
|
84
|
-
cy.get('@container')
|
|
85
|
-
.should('exist');
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it('has view code button', () => {
|
|
89
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
it('shows code on click', () => {
|
|
93
|
-
cy.get('@viewCodeBtn').click();
|
|
94
|
-
cy.get('@container')
|
|
95
|
-
.find('textarea')
|
|
96
|
-
.should('exist');
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
describe('Single image section', () => {
|
|
101
|
-
beforeEach(() => {
|
|
102
|
-
cy.visit('/#picture');
|
|
103
|
-
cy.get('[data-testid="Picture-example-5"]')
|
|
104
|
-
.as('container')
|
|
105
|
-
.find('[data-preview="Picture"]')
|
|
106
|
-
.as('preview');
|
|
107
|
-
|
|
108
|
-
cy.get('@container')
|
|
109
|
-
.find('button')
|
|
110
|
-
.contains('View Code')
|
|
111
|
-
.as('viewCodeBtn');
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
it('should check custom size picture section', () => {
|
|
115
|
-
cy.get('@container')
|
|
116
|
-
.should('exist');
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
it('has view code button', () => {
|
|
120
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
it('shows code on click', () => {
|
|
124
|
-
cy.get('@viewCodeBtn').click();
|
|
125
|
-
cy.get('@container')
|
|
126
|
-
.find('textarea')
|
|
127
|
-
.should('exist');
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
});
|