Skip to content

Commit

Permalink
added base venue tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmit-coder committed Sep 19, 2024
1 parent 884c155 commit 6e17151
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/Agenda/agenda.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Image from 'next/image'

function Agenda({ city }) {
return (
<div className=''>
<div className='' data-test="agenda-com">
<div className='flex flex-col justify-center items-center'>

<Heading className='text-[30px] text-white'>
Expand Down
2 changes: 1 addition & 1 deletion components/Speaker/guideline.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const faqs = [
function Guidelines({talkDeadLine,virtual,name,cfp}) {
const [show, setShow] = useState(null);
return (
<div className='z-[9]'>
<div className='z-[9]' data-test="guideline-com">
<div className='flex flex-col justify-center'>
<Heading className='text-[30px] text-white text-center'>Speakers Guideline</Heading>
<div className='mt-20'>
Expand Down
19 changes: 19 additions & 0 deletions cypress/e2e/Venue.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import cities from "../../config/city-lists.json"

it("should render guideline for not ended cities and agenda otherwise",()=>{
cy.wrap(cities).each(city => {
cy.visit(`http://localhost:3000/venue/${city.name}`);

cy.getTestData(`venue-${city.name}`).then(val=>{

if(!city.ended){
cy.getTestData("guideline-com").should("be.visible");
}
else{
cy.getTestData("agenda-com").should("be.visible");
}
});

})

});
2 changes: 1 addition & 1 deletion pages/venue/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function getStaticPaths() {

function Venue({ city }) {
return (
<div>
<div data-test={`venue-${city.name}`}>
<div className= {`w-full h-[500px] sm:h-[auto] ${city.name=='Online'?'bg-online':'bg-madrid'} bg-cover bg-center`}>
<div className='w-full h-full kinda-dark items-center flex flex-col justify-between'>
<div className='mt-[82px] container text-center flex flex-col items-center w-[1100px] lg:w-full sm:text-center'>
Expand Down

0 comments on commit 6e17151

Please sign in to comment.