@@ -36,20 +36,62 @@ describe('Footer links', () => {
3636 it ( 'Linkedin should redirect to correct page' , ( ) => {
3737 cy . getTestData ( 'footer-Linkedin' ) . invoke ( 'removeAttr' , 'target' ) . click ( ) ;
3838
39- cy . origin ( 'https://www.linkedin.com/company/asyncapi/ ' , ( ) => {
40- cy . url ( ) . should ( 'eq ' , 'https://www. linkedin.com/company/asyncapi/ ' ) ;
39+ cy . origin ( 'https://www.linkedin.com' , ( ) => {
40+ cy . url ( ) . should ( 'include ' , 'linkedin.com/company/asyncapi' ) ;
4141 } ) ;
4242 } ) ;
4343
4444 it ( 'Twitter(X) should redirect to correct page' , ( ) => {
4545 cy . getTestData ( 'footer-Twitter(X)' ) . invoke ( 'removeAttr' , 'target' ) . click ( ) ;
4646
47- cy . origin ( 'https://x.com/asyncapispec ' , ( ) => {
48- cy . url ( ) . should ( 'match ' , / . * a s y n c a p i s p e c . * / ) ;
47+ cy . origin ( 'https://x.com' , ( ) => {
48+ cy . url ( ) . should ( 'include ' , ' asyncapispec' ) ;
4949 } ) ;
5050 } ) ;
5151
52- it ( 'Should Contain AsycAPI Conference Logo' , ( ) => {
52+ it ( 'YouTube should redirect to correct page' , ( ) => {
53+ cy . getTestData ( 'footer-youtube' )
54+ . should ( 'have.attr' , 'href' , 'https://www.youtube.com/asyncapi' ) ;
55+ } ) ;
56+
57+ it ( 'Should Contain AsyncAPI Conference Logo' , ( ) => {
5358 cy . getTestData ( 'footer-asyncAPI-logo' ) . should ( 'be.visible' ) ;
5459 } ) ;
60+
61+ describe ( 'Social Media Icons' , ( ) => {
62+ beforeEach ( ( ) => {
63+ cy . visit ( '/' ) ;
64+ } ) ;
65+
66+ it ( 'Should display social media icons' , ( ) => {
67+ cy . getTestData ( 'social-wrapper' ) . should ( 'exist' ) ;
68+ cy . getTestData ( 'footer-icon-linkedin' ) . should ( 'exist' ) ;
69+ cy . getTestData ( 'footer-icon-github' ) . should ( 'exist' ) ;
70+ cy . getTestData ( 'footer-icon-twitter' ) . should ( 'exist' ) ;
71+ cy . getTestData ( 'footer-icon-youtube' ) . should ( 'exist' ) ;
72+ } ) ;
73+
74+ const socialPlatforms = [
75+ { dataTest : 'footer-tooltip-linkedin' , name : 'LinkedIn' } ,
76+ { dataTest : 'footer-tooltip-github' , name : 'GitHub' } ,
77+ { dataTest : 'footer-tooltip-twitter' , name : 'Twitter' } ,
78+ { dataTest : 'footer-tooltip-youtube' , name : 'YouTube' } ,
79+ ] ;
80+
81+ socialPlatforms . forEach ( ( platform ) => {
82+ it ( `Should display tooltip when hovering over ${ platform . name } icon` , ( ) => {
83+ cy . getTestData ( platform . dataTest ) . invoke (
84+ 'addClass' ,
85+ 'show-for-test'
86+ ) ;
87+ cy . getTestData ( platform . dataTest ) . should (
88+ 'be.visible'
89+ ) ;
90+ cy . getTestData ( platform . dataTest ) . should (
91+ 'contain' ,
92+ platform . name
93+ ) ;
94+ } ) ;
95+ } ) ;
96+ } ) ;
5597} ) ;
0 commit comments