Skip to content

Commit

Permalink
add-promo-banner
Browse files Browse the repository at this point in the history
  • Loading branch information
thulieblack committed May 3, 2024
1 parent 360958b commit 39fd0ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions cypress/test/components/campaignTests/AnnouncementHero.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ beforeEach(() => {

// .skip should be removed once the AnnouncementHero component is rendered in the website
describe('AnnouncementHero Component', () => {
it.skip('should render the component when the date is within the valid range', () => {
it('should render the component when the date is within the valid range', () => {
const mockDate = new Date(2021, 10, 12).getTime();
cy.clock(mockDate);
cy.get('[data-testid="AnnouncementHero-main-div"]').should('exist');
});

//check if announcement rendered is small or large .
it.skip('should render a small announcement when "small" prop is true', () => {
it('should render a small announcement when "small" prop is true', () => {
mount(<AnnouncementHero small />);
cy.get('[data-testid="AnnouncementHero-main-div"]').should('have.class', 'mb-4');
});

it.skip('should display the correct event information', () => {
it('should display the correct event information', () => {
// Assert the event details
cy.get('[data-testid="Paragraph-test"]').should('exist');
cy.get('h2').should('exist');

});

it.skip('should have a link and text for the button', () => {
it('should have a link and text for the button', () => {
mount(<AnnouncementHero />);
cy.get('[data-testid="Button-link"]')
.should('have.attr', 'target', '_blank')
Expand All @@ -40,7 +40,7 @@ describe('AnnouncementHero Component', () => {
});

//check if announcement rendered is small or large .
it.skip('should render a small announcement when "small" prop is true', () => {
it('should render a small announcement when "small" prop is true', () => {
const mockDate = new Date('2023-05-01T00:00:00Z');
cy.clock(mockDate.getTime());

Expand All @@ -49,7 +49,7 @@ describe('AnnouncementHero Component', () => {
cy.get('[data-testid="AnnouncementHero-main-div"]').should('have.class', 'mb-4');
});

it.skip('should render a large announcement when "small" prop is false', () => {
it('should render a large announcement when "small" prop is false', () => {
const mockDate = new Date('2023-05-01T00:00:00Z');
cy.clock(mockDate.getTime());

Expand Down
10 changes: 5 additions & 5 deletions cypress/test/components/campaignTests/Banner.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Banner from '../../../../components/campaigns/Banner';

// .skip should be removed once the Banner component is rendered in the website with default functionalities
describe('Banner Component', () => {
it.skip('should not render the banner when the date is not within the valid range', () => {
it('should not render the banner when the date is not within the valid range', () => {
const today = new Date();
const [day, month, year] = [today.getUTCDate(), today.getUTCMonth(), today.getUTCFullYear()];
if (year > 2022 || month !== 10 || day < 6) {
Expand All @@ -18,21 +18,21 @@ describe('Banner Component', () => {
}
});

it.skip('should render the banner when the date is within the valid range', () => {
it('should render the banner when the date is within the valid range', () => {
const mockDate = new Date(2021, 10, 12).getTime();
cy.clock(mockDate);
mount(<Banner />);
cy.get('[data-testid="Banner-main-div"]').should('be.visible');
});

it.skip('should display the correct message when the date is within the valid range', () => {
it('should display the correct message when the date is within the valid range', () => {
const mockDate = new Date(2021, 10, 12).getTime();
cy.clock(mockDate);
mount(<Banner />);
cy.contains('.font-medium', 'AsyncAPI Conference 2022 has ended').should('be.visible');
});

it.skip('should have a link to the recordings playlist', () => {
it('should have a link to the recordings playlist', () => {
const mockDate = new Date(2021, 10, 12).getTime();
cy.clock(mockDate);
mount(<Banner />);
Expand All @@ -42,7 +42,7 @@ describe('Banner Component', () => {
.should('have.attr', 'rel', 'noopener noreferrer');
});

it.skip('should have the max-w-screen-xl class in the div element', () => {
it('should have the max-w-screen-xl class in the div element', () => {
const mockDate = new Date(2021, 10, 12).getTime();
cy.clock(mockDate);
mount(<Banner />);
Expand Down

0 comments on commit 39fd0ae

Please sign in to comment.