-
-
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.
add tests for CaseStudyCard(component) , pages (caseStudy ,TOOLS , NE…
…WSLETTER)
- Loading branch information
1 parent
7318a17
commit 53d779d
Showing
12 changed files
with
131 additions
and
6 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,23 @@ | ||
import React from 'react'; | ||
import { mount } from 'cypress/react'; | ||
import CaseStudyCard from '../../components/CaseStudyCard'; | ||
import CaseStudiesList from "../../config/case-studies.json"; | ||
describe('CaseStudyCard Component', () => { | ||
|
||
it('renders the CaseStudyCard component with study data', () => { | ||
mount(<CaseStudyCard studies={CaseStudiesList} />); | ||
|
||
cy.get('[data-testid="CaseStudyCard-main"]').should('have.length', 1); | ||
|
||
CaseStudiesList.forEach((study, index) => { | ||
cy.get(`.rounded-md:eq(${index}) img`).should('have.attr', 'src', study.company.logo); | ||
cy.get(`.rounded-md:eq(${index}) img`).should('have.attr', 'alt', study.company.name); | ||
}); | ||
}); | ||
|
||
it('does not render anything when studies array is empty', () => { | ||
mount(<CaseStudyCard studies={[]} />); | ||
|
||
cy.get('.rounded-md').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,14 @@ | ||
import Casestudies from "../../../../pages/casestudies"; | ||
import MockApp from "../../../utils/MockApp"; | ||
import {mount} from 'cypress/react'; | ||
describe('Test for Case Study Pages', () => { | ||
it('renders correctly', () => { | ||
mount( | ||
<MockApp> | ||
<Casestudies /> | ||
</MockApp> | ||
); | ||
cy.get('[data-testid="CaseStudy-main"]').should('exist'); | ||
cy.get('[data-testid="CaseStudy-card"]').should('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,12 @@ | ||
import NewsletterIndexPage from "../../../../pages/newsletter"; | ||
import MockApp from "../../../utils/MockApp"; | ||
import {mount} from 'cypress/react'; | ||
describe('Test for Newsletter', () => { | ||
it('renders correctly', () => { | ||
mount( | ||
<MockApp> | ||
<NewsletterIndexPage/> | ||
</MockApp> | ||
); | ||
}); | ||
}); |
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,12 @@ | ||
import CliPage from "../../../../pages/tools/cli"; | ||
import MockApp from "../../../utils/MockApp"; | ||
import {mount} from 'cypress/react'; | ||
describe('Test for cli tools ', () => { | ||
it('renders correctly', () => { | ||
mount( | ||
<MockApp> | ||
<CliPage /> | ||
</MockApp> | ||
); | ||
}); | ||
}); |
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,13 @@ | ||
|
||
import GeneratorPage from "../../../../pages/tools/generator"; | ||
import MockApp from "../../../utils/MockApp"; | ||
import {mount} from 'cypress/react'; | ||
describe('Test for generator tools', () => { | ||
it('renders correctly', () => { | ||
mount( | ||
<MockApp> | ||
<GeneratorPage /> | ||
</MockApp> | ||
); | ||
}); | ||
}); |
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,13 @@ | ||
|
||
import GithubActionsPage from "../../../../pages/tools/github-actions"; | ||
import MockApp from "../../../utils/MockApp"; | ||
import {mount} from 'cypress/react'; | ||
describe('Test for Github Actions ', () => { | ||
it('renders correctly', () => { | ||
mount( | ||
<MockApp> | ||
<GithubActionsPage /> | ||
</MockApp> | ||
); | ||
}); | ||
}); |
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,12 @@ | ||
import Toolsdashboard from "../../../../pages/tools"; | ||
import MockApp from "../../../utils/MockApp"; | ||
import {mount} from 'cypress/react'; | ||
describe('Test for Tools Dashboard', () => { | ||
it('renders correctly', () => { | ||
mount( | ||
<MockApp> | ||
<Toolsdashboard/> | ||
</MockApp> | ||
); | ||
}); | ||
}); |
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,13 @@ | ||
|
||
import ModelinaPlaygroundPage from "../../../../pages/tools/modelina"; | ||
import MockApp from "../../../utils/MockApp"; | ||
import {mount} from 'cypress/react'; | ||
describe('Test for Modelina Pages', () => { | ||
it('renders correctly', () => { | ||
mount( | ||
<MockApp> | ||
<ModelinaPlaygroundPage/> | ||
</MockApp> | ||
); | ||
}); | ||
}); |
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,13 @@ | ||
|
||
import ParsersPage from "../../../../pages/tools/parsers"; | ||
import MockApp from "../../../utils/MockApp"; | ||
import {mount} from 'cypress/react'; | ||
describe('Test for Parsers', () => { | ||
it('renders correctly', () => { | ||
mount( | ||
<MockApp> | ||
<ParsersPage/> | ||
</MockApp> | ||
); | ||
}); | ||
}); |
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