Skip to content

Commit ff32d9e

Browse files
fix: sponsor and subscribe section width on home page. (asyncapi#480)
* Fixed width for sponsor and subscribe section on home page * Fixed sponsor render issue on venue pages * Added cypress test for checking sponsor logos rendering * Imported hardcode data from city.json * Made changes to if condition in venue.cy.js --------- Co-authored-by: Cody's Dad <[email protected]>
1 parent 1ab3848 commit ff32d9e

File tree

6 files changed

+126
-18
lines changed

6 files changed

+126
-18
lines changed

config/city-lists.json

+73-13
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,25 @@
77
"description": "Join us for the AsyncAPI Online Conference Edition as the community unites across the globe to share experiences, collaborate, and foster meaningful connections.",
88
"img": "/img/testMic.webp",
99
"address": "AsyncAPI YouTube Channel",
10-
"map": "https://www.youtube.com/playlist?list=PLbi1gRlP7pijItMBmw9SeeyWxuEa3jLR2",
11-
"sponsors": [
12-
"/img/apidays.png"
13-
],
10+
"map": "https://www.youtube.com/live/F9wHxd-v2f0?si=PT8BuAUKNmoLHRiM",
11+
"sponsors": {
12+
"eventSponsors" : [{
13+
"image":"/img/apidays.png",
14+
"websiteUrl":"https://www.apidays.global/"
15+
}],
16+
"financialSponsors" : [
17+
{
18+
"image":"/img/graviteeio.svg" ,
19+
"websiteUrl": "https://www.gravitee.io/",
20+
"className":"w-[250px] h-[50px]"
21+
},
22+
{
23+
"image":"/img/postman.png" ,
24+
"websiteUrl":"https://www.postman.com/",
25+
"className":"w-[240px] h-[70px]"
26+
}
27+
]
28+
},
1429
"ticket": false,
1530
"isFree": true,
1631
"ended": true,
@@ -27,9 +42,24 @@
2742
"img": "/img/finland.webp",
2843
"address": "Pikku-Finlandia, Helsinki, Karamzininranta 4, 00100 Helsinki, Finland",
2944
"map": "https://maps.app.goo.gl/UpdEp188m5YNEAEo9",
30-
"sponsors": [
31-
"/img/apidays.png"
32-
],
45+
"sponsors": {
46+
"eventSponsors" : [{
47+
"image":"/img/apidays.png",
48+
"websiteUrl":"https://www.apidays.global/"
49+
}],
50+
"financialSponsors" : [
51+
{
52+
"image":"/img/graviteeio.svg" ,
53+
"websiteUrl": "https://www.gravitee.io/",
54+
"className":"w-[250px] h-[50px]"
55+
},
56+
{
57+
"image":"/img/postman.png" ,
58+
"websiteUrl":"https://www.postman.com/",
59+
"className":"w-[240px] h-[70px]"
60+
}
61+
]
62+
},
3363
"ticket": false,
3464
"isFree": false,
3565
"ended": true
@@ -43,9 +73,24 @@
4373
"img": "/img/london.gif",
4474
"address": "155 Bishopsgate, London EC2M 3YD",
4575
"map": "https://maps.app.goo.gl/b2Vb5H2mM41F9nQA6",
46-
"sponsors": [
47-
"/img/apidays.png"
48-
],
76+
"sponsors": {
77+
"eventSponsors" : [{
78+
"image":"/img/apidays.png",
79+
"websiteUrl":"https://www.apidays.global/"
80+
}],
81+
"financialSponsors" : [
82+
{
83+
"image":"/img/graviteeio.svg" ,
84+
"websiteUrl": "https://www.gravitee.io/",
85+
"className":"w-[250px] h-[50px]"
86+
},
87+
{
88+
"image":"/img/postman.png" ,
89+
"websiteUrl":"https://www.postman.com/",
90+
"className":"w-[240px] h-[70px]"
91+
}
92+
]
93+
},
4994
"ticket": "https://ticket.apidays.global/event/apidays-london-2024/869eca20-bfb6-4103-b8bb-d0348932e940/",
5095
"isFree": true,
5196
"ended": true,
@@ -61,9 +106,24 @@
61106
"img": "https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExd24yenR4djEyZzRoeDA0ZmEyb3Y1c2F4NWVmbG13NmZwYWNhZzdnNiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/Tuy3QxNZF1cxG/giphy.gif",
62107
"address": "CNIT (Centre des Nouvelles Industries et Technologies), Paris 2 Place de la Défense, 92092 Puteaux",
63108
"map": "https://maps.app.goo.gl/5te8WRM9Rb8B6vNd9",
64-
"sponsors": [
65-
"/img/apidays.png"
66-
],
109+
"sponsors": {
110+
"eventSponsors" : [{
111+
"image":"/img/apidays.png",
112+
"websiteUrl":"https://www.apidays.global/"
113+
}],
114+
"financialSponsors" : [
115+
{
116+
"image":"/img/graviteeio.svg" ,
117+
"websiteUrl": "https://www.gravitee.io/",
118+
"className":"w-[250px] h-[50px]"
119+
},
120+
{
121+
"image":"/img/postman.png" ,
122+
"websiteUrl":"https://www.postman.com/",
123+
"className":"w-[240px] h-[70px]"
124+
}
125+
]
126+
},
67127
"ticket": "https://ticket.apidays.global/event/apidays-paris-2024/f8f61349-4f78-4bba-a162-68d598833116/cart?coupon=ASYNCAPICONF",
68128
"isFree": true,
69129
"cfp": false,

cypress/e2e/Landing.cy.js

+22
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import path from "path";
2+
import cities from "../../config/city-lists.json"
3+
24
describe("Landing Page Tests", () => {
35
beforeEach(() => {
46
cy.visit("/");
@@ -33,6 +35,26 @@ describe("Landing Page Tests", () => {
3335
cy.getTestData("sponsor-section").should("be.visible");
3436
});
3537

38+
it("Should contain logos in Sponsor component", () => {
39+
const eventSponsors = cities[0].sponsors.eventSponsors;
40+
41+
const financialSponsor = cities[0].sponsors.financialSponsors;
42+
43+
eventSponsors.forEach((sponsor) => {
44+
cy.getTestData('sponsor-section')
45+
.find(`img[src="${sponsor.image}"]`)
46+
.should('be.visible');
47+
cy.get(`a[href="${sponsor.websiteUrl}"]`).should('exist');
48+
});
49+
50+
financialSponsor.forEach((sponsor) => {
51+
cy.getTestData('sponsor-section')
52+
.find(`img[src="${sponsor.image}"]`)
53+
.should('be.visible');
54+
cy.get(`a[href="${sponsor.websiteUrl}"]`).should('exist');
55+
});
56+
});
57+
3658
it("Subscribe Button is functional", () => {
3759
cy.getTestData("subscribe-button").invoke("removeAttr", "target").click();
3860

cypress/e2e/Venue.cy.js

+28-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ it("should render guideline for not ended cities and agenda otherwise",()=>{
66

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

9-
if(!city.ended){
9+
if(Date.now()>Date(city.date) && !city.ended){
1010
cy.getTestData("guideline-com").should("be.visible");
1111
}
1212
else{
@@ -18,7 +18,33 @@ it("should render guideline for not ended cities and agenda otherwise",()=>{
1818

1919
});
2020

21-
it.only("Form should work",()=>{
21+
it("Should contain logos in Sponsor component", () => {
22+
const eventSponsors = cities[0].sponsors.eventSponsors;
23+
24+
const financialSponsor = cities[0].sponsors.financialSponsors;
25+
26+
cy.wrap(cities).each((city) => {
27+
cy.visit(`http://localhost:3000/venue/${city.name}`);
28+
29+
cy.getTestData("sponsor-section").should("exist");
30+
31+
eventSponsors.forEach((sponsor) => {
32+
cy.getTestData('sponsor-section')
33+
.find(`img[src="${sponsor.image}"]`)
34+
.should('be.visible');
35+
cy.get(`a[href="${sponsor.websiteUrl}"]`).should('exist');
36+
});
37+
38+
financialSponsor.forEach((sponsor) => {
39+
cy.getTestData('sponsor-section')
40+
.find(`img[src="${sponsor.image}"]`)
41+
.should('be.visible');
42+
cy.get(`a[href="${sponsor.websiteUrl}"]`).should('exist');
43+
});
44+
})
45+
});
46+
47+
it("Form should work",()=>{
2248
cy.visit('http://localhost:3000/venue/online/register');
2349

2450
cy.getTestData("cfp-form").should('be.visible');

pages/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,13 @@ export default function Home() {
185185
</div>
186186
</div>
187187
</div>
188+
</div>
188189
<div id='sponsors' className='mt-20'>
189190
<Sponsors eventSponsors={[{image:'/img/apidays.png',websiteUrl:"https://www.apidays.global/"}]} financialSponsor={[{image:"/img/graviteeio.svg" , websiteUrl: "https://www.gravitee.io/",className:"w-[250px] h-[50px]" } , {image:"/img/postman.png" ,websiteUrl:"https://www.postman.com/",className:"w-[240px] h-[70px]"}]} />
190191
</div>
191192
<div className='mt-5'>
192193
<Subscription/>
193194
</div>
194195
</div>
195-
</div>
196196
);
197197
}

pages/venue/[id].js

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function Venue({ city }) {
9393
<div
9494
id='sponsors'
9595
>
96-
<Sponsors imgs={city.sponsors} />
96+
<Sponsors eventSponsors={city.sponsors.eventSponsors} financialSponsor={city.sponsors.financialSponsors} />
9797
</div>
9898
</div>
9999
);

pages/venue/online/register/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function SpeakersForm(){
77
<Paper />
88
</div>
99
<div>
10-
<Sponsors imgs={cfpData.sponsors} />
10+
<Sponsors eventSponsors={[{image:'/img/apidays.png',websiteUrl:"https://www.apidays.global/"}]} financialSponsor={[{image:"/img/graviteeio.svg" , websiteUrl: "https://www.gravitee.io/",className:"w-[250px] h-[50px]" } , {image:"/img/postman.png" ,websiteUrl:"https://www.postman.com/",className:"w-[240px] h-[70px]"}]} />
1111
</div>
1212
</div>)
1313
}

0 commit comments

Comments
 (0)