Skip to content

Commit

Permalink
Update code formatting and spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
akshatnema committed Jul 17, 2023
1 parent 2051b90 commit 1444783
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
7 changes: 2 additions & 5 deletions cypress/test/newsroom/Newsroom.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,20 @@ describe('Newsroom Component', () => {
beforeEach(() => {
mount(<Newsroom />);
});

it('renders without errors', () => {
cy.get('[data-testid="Newsroom-main"]').contains(newsroomHeadings[0])
cy.get('[data-testid="Newsroom-sub-div"]').contains(newsroomHeadings[1])
cy.get('[data-testid="Newsroom-Blog"]').should('exist')


});

it('checks link href', () => {
cy.get('[data-testid="Newsroom-Blog-Link"]').find('a').should('have.attr', 'href', '/blog') // Check the blog href attribute
cy.get('[ data-testid="Newsroom-Twitter-Link"]').find('a').should('have.attr', 'href', 'https://twitter.com/AsyncAPISpec') //check twitter
cy.get('[data-testid="Newsroom-Youtube"]').find('a').should('have.attr', 'href', 'https://www.youtube.com/c/AsyncAPI') //check youtube link

});

it('checks TwitterTimelineEmbed', () => {
cy.get('[data-testid="Newsroom-Twitter"]').should('exist'); // data-test was not working
});


});
1 change: 0 additions & 1 deletion cypress/test/newsroom/NewsroomArticle.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ describe('Newsroom Article Component', () => {
cy.get(`[data-testid="NewsroomArticle-${ index }"]`).should('have.attr', 'href', article.url);
cy.get(`[data-testid="NewsroomArticle-${ index }"]`).should('contain.text', article.title);
cy.get(`[data-testid="NewsroomArticle-${ index }"]`).should('contain.text', article.publishDate);

});
});
});
5 changes: 1 addition & 4 deletions cypress/test/newsroom/NewsroomSection.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,14 @@ describe('Newsroom Section Component', () => {
mount(<NewsroomSection />);
});

it('renders without errors', () => {
it('renders without errors', () => {});

});
it('check if Features Blog Post exists', () => {
cy.get('[data-testid="NewsroomSection-Featured"]').should('exist');

});

it('check content of Newsroom component', () => {
cy.get('[data-testid="NewsroomSection-main"]').contains(newsroom[0]);
})

});

8 changes: 4 additions & 4 deletions cypress/test/newsroom/NewsroomYoutube.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ import NewsroomYoutube from '../../../components/newsroom/NewsroomYoutube';
describe('Newsroom Youtube', () => {
beforeEach(() => {
mount(<NewsroomYoutube />);
});
it('renders without errors', () => {

});

it('renders without errors', () => {});

it('checks if swiper component is present', () => {
cy.get('[ data-testid="NewsroomYoutube-main"]').should('exist')

});

it('checks if the first slide is active', () => {
cy.get('.swiper-slide-active').should('exist')
});

it('slides to the next slide', () => {
cy.get('[data-testid="Youtube-Next-button"]').click({force: true })
cy.get('.swiper-slide-active').should('exist')
Expand Down
2 changes: 0 additions & 2 deletions cypress/test/newsroom/swiper.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import { checkLastSnapIndex } from '../../../components/newsroom/swiper';
describe('checkLastSnapIndex', () => {
it('should check the last snap index correctly for different viewport widths', () => {
cy.viewport(1280, 720); // Set the viewport width to 1280px

const isLastSnapIndex1 = checkLastSnapIndex(3);
expect(isLastSnapIndex1).to.be.false;

cy.viewport(640, 480); // Set the viewport width to 640px

const isLastSnapIndex2 = checkLastSnapIndex(4);
expect(isLastSnapIndex2).to.be.true;
});
Expand Down

0 comments on commit 1444783

Please sign in to comment.