-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Dev' into CodedVeli/issue238
- Loading branch information
Showing
16 changed files
with
224 additions
and
25 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
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
5 changes: 3 additions & 2 deletions
5
src/pages/community/sections/eventsPreview/SingleEvents/sections/EventDescription.jsx
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,20 @@ | ||
/* eslint-disable react/no-array-index-key */ | ||
import React from "react"; | ||
// .split("\r\n\r\n") Splits by paragraphs | ||
// .split("\r\n") splits by lines | ||
const formatEventDescription = (text) => | ||
text.split("\r\n\r\n").map((paragraph) => ( | ||
<p key={crypto.randomUUID()} className="leading-6 mb-4 whitespace-pre-wrap"> | ||
{paragraph.split("\r\n").map((line, i) => ( | ||
<React.Fragment key={i}> | ||
{line} | ||
{i < paragraph.split("\r\n").length - 1 && ( | ||
// Adds space between lines | ||
<br className="mb-2" /> | ||
)} | ||
</React.Fragment> | ||
))} | ||
</p> | ||
)); | ||
|
||
export default formatEventDescription; |
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,89 @@ | ||
import { render, screen } from "@testing-library/react"; | ||
import { HelmetProvider } from "react-helmet-async"; | ||
import { BrowserRouter } from "react-router-dom"; | ||
import { describe, expect, it } from "vitest"; | ||
|
||
import placeholder from "../../src/assets/images/sytLogo.png"; | ||
import Caroussel from "../../src/components/Caroussel"; | ||
import AboutUs from "../../src/pages/aboutUs/AboutUs"; | ||
|
||
const LeadershipData = [ | ||
{ | ||
name: "First User", | ||
title: "Founder", | ||
image: placeholder, | ||
linkedin: { | ||
href: "https://www.linkedin.com/", | ||
username: "First User", | ||
}, | ||
twitter: { | ||
href: "https://twitter.com/x", | ||
username: "First User", | ||
}, | ||
}, | ||
{ | ||
name: "Second User", | ||
title: "Dev Relations & Opensource Programs", | ||
image: placeholder, | ||
linkedin: { | ||
href: "https://www.linkedin.com", | ||
username: "Second User", | ||
}, | ||
twitter: { | ||
href: "", | ||
username: "", | ||
}, | ||
}, | ||
{ | ||
name: "Third User", | ||
title: "Community Manager", | ||
image: placeholder, | ||
linkedin: { | ||
href: "https://www.linkedin.com", | ||
username: "Third User", | ||
}, | ||
twitter: { | ||
href: "", | ||
username: "", | ||
}, | ||
}, | ||
]; | ||
|
||
describe("About us page unit tests", () => { | ||
const renderWithRouter = (ui) => | ||
render( | ||
<HelmetProvider> | ||
<BrowserRouter>{ui}</BrowserRouter> | ||
</HelmetProvider> | ||
); | ||
|
||
it("should render Hero Section successfully", () => { | ||
renderWithRouter(<AboutUs />); | ||
const titleElement = screen.getByTestId("title"); | ||
expect(titleElement).toBeTruthy(); | ||
}); | ||
|
||
it("should render Mission/Vision Section successfully", () => { | ||
renderWithRouter(<AboutUs />); | ||
const testElement = screen.getByTestId("mission"); | ||
expect(testElement).toBeTruthy(); | ||
}); | ||
|
||
it("should render Leadership Section successfully", () => { | ||
renderWithRouter(<AboutUs />); | ||
const testElement = screen.getByTestId("leadership"); | ||
expect(testElement).toBeTruthy(); | ||
}); | ||
|
||
it("should render Reports Section successfully", () => { | ||
renderWithRouter(<AboutUs />); | ||
const testElement = screen.getByTestId("reports"); | ||
expect(testElement).toBeTruthy(); | ||
}); | ||
|
||
it("should render leadership carousel successfully", () => { | ||
renderWithRouter(<Caroussel CarousselData={LeadershipData} />); | ||
const carouselElement = screen.getByTestId("carousel"); | ||
expect(carouselElement).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.