-
-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/roadmap_modal
- Loading branch information
Showing
30 changed files
with
495 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
** |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react'; | ||
import { mount } from 'cypress/react'; | ||
import ApplyJobButton from '../../../components/buttons/ApplyJob'; | ||
|
||
describe('ApplyJobButton', () => { | ||
const job = { | ||
contact: 'https://www.asyncapi.com/', | ||
}; | ||
|
||
beforeEach(() => { | ||
mount(<ApplyJobButton job={job} />); | ||
}); | ||
|
||
it('renders the ApplyJobButton component', () => { | ||
cy.contains('Apply for this job').should('exist'); | ||
}); | ||
|
||
it('sets the correct href and target attributes', () => { | ||
cy.get('[data-testid="Button-link"]').should('have.attr', 'href', 'https://www.asyncapi.com/'); | ||
cy.get('[data-testid="Button-link"]').should('have.attr', 'target', '_blank'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import React from 'react'; | ||
import { mount } from 'cypress/react'; | ||
import Button from '../../../components/buttons/Button'; | ||
import IconGithub from '../../../components/icons/Github' | ||
describe('Button component', () => { | ||
it('renders a button without href', () => { | ||
const text = 'Click me'; | ||
const type = 'button'; | ||
const icon = <IconGithub />; | ||
mount( | ||
<Button text={text} type={type} icon={icon} /> | ||
); | ||
cy.get('[data-testid="Button-main"]').should('have.text', text); | ||
cy.get('[data-testid="Button-main"]').should('have.attr', 'type', type); | ||
cy.get('[data-testid="Button-link"]').should('not.exist'); | ||
}); | ||
|
||
it('renders a button with href', () => { | ||
const text = 'Click me'; | ||
const href = '/link'; | ||
const target = '_blank'; | ||
mount( | ||
<Button text={text} href={href} target={target} /> | ||
); | ||
cy.get('[data-testid="Button-link"]').should('have.text', text); | ||
cy.get('[data-testid="Button-link"]').should('have.attr', 'href', href); | ||
cy.get('[data-testid="Button-link"]').should('have.attr', 'target', target); | ||
cy.get('[data-testid="Button-main"]').should('not.exist'); | ||
}); | ||
|
||
it('renders a small button', () => { | ||
const text = 'Click me'; | ||
const buttonSize = 'small'; | ||
mount( | ||
<Button text={text} buttonSize={buttonSize} /> | ||
); | ||
cy.get('[data-testid="Button-main"]').should('have.class', 'px-3 py-2 text-sm'); | ||
}); | ||
it('renders a button with custom class', () => { | ||
const text = 'Click me'; | ||
const className = 'custom-button'; | ||
|
||
mount( | ||
<Button text={text} className={className} /> | ||
); | ||
cy.get('[data-testid="Button-main"]').should('have.class', className); | ||
}); | ||
|
||
it('does not render an icon with position left in the button', () => { | ||
const text = 'Click me'; | ||
mount( | ||
<Button text={text} /> | ||
); | ||
cy.get('[data-testid="Button-icon-left"]').should('not.exist'); | ||
}); | ||
|
||
it('does not render an icon with position left in the button', () => { | ||
const text = 'Click me'; | ||
mount( | ||
<Button text={text} /> | ||
); | ||
cy.get('[data-testid="Button-icon-right"]').should('not.exist'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react'; | ||
import { mount } from 'cypress/react'; | ||
import ChapterSuggestion from '../../../components/buttons/ChapterSuggestion'; | ||
describe('ChapterSuggestion', () => { | ||
const chapter = { | ||
href: 'https://www.asyncapi.com/', | ||
target: '_self', | ||
title: 'Chapter Title', | ||
description: 'Chapter Description', | ||
linkText: 'Read More', | ||
className: 'custom-class', | ||
}; | ||
beforeEach(() => { | ||
mount(<ChapterSuggestion {...chapter} />); | ||
}); | ||
|
||
it('renders the ChapterSuggestion component', () => { | ||
cy.contains(chapter.title).should('exist'); | ||
cy.contains(chapter.description).should('exist'); | ||
cy.contains(chapter.linkText).should('exist'); | ||
cy.get('[data-testid="ChapterSuggestion-link"]').should('have.attr', 'href', chapter.href); | ||
}); | ||
|
||
it('applies the correct className', () => { | ||
cy.get('[data-testid="ChapterSuggestion-link"]').should('have.class', chapter.className); | ||
}); | ||
|
||
it('sets the target attribute', () => { | ||
cy.get('[data-testid="ChapterSuggestion-link"]').should('have.attr', 'target', chapter.target); | ||
}); | ||
|
||
it('sets the title attribute', () => { | ||
cy.get('[data-testid="ChapterSuggestion-link"]').should('have.attr', 'title', chapter.description); | ||
}); | ||
|
||
it('renders the link text and IconArrowRight', () => { | ||
cy.contains(chapter.linkText).should('exist'); | ||
cy.get('svg').should('have.class', 'h-4'); | ||
}); | ||
}); |
Oops, something went wrong.