@conorheffron/ironoc-frontend 7.2.2 → 7.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/package.json +4 -3
- package/src/App.css +2 -0
- package/src/App.test.js +56 -0
- package/src/components/Donate.js +13 -0
package/README.md
CHANGED
|
@@ -24,6 +24,9 @@ npm run start
|
|
|
24
24
|
|
|
25
25
|
# press a/enter after the following command to run test suite
|
|
26
26
|
npm run test
|
|
27
|
+
|
|
28
|
+
#check test coverage
|
|
29
|
+
npm run test:coverage
|
|
27
30
|
```
|
|
28
31
|
|
|
29
32
|
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conorheffron/ironoc-frontend",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@fontsource/montserrat": "^5.1.1",
|
|
7
7
|
"@fontsource/open-sans": "^5.1.1",
|
|
8
8
|
"@testing-library/user-event": "^13.5.0",
|
|
9
|
-
"axios": "^
|
|
9
|
+
"axios": "^1.8.2",
|
|
10
10
|
"bootstrap": "5.1",
|
|
11
11
|
"react": "^18.3.1",
|
|
12
12
|
"react-bootstrap": "^2.10.5",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"start": "react-scripts start",
|
|
25
25
|
"build": "CI=false && GENERATE_SOURCEMAP=false react-scripts build",
|
|
26
|
-
"test": "react-scripts test",
|
|
26
|
+
"test": "react-scripts test --transformIgnorePatterns \"node_modules/(?!axios)/\"",
|
|
27
|
+
"test:coverage": "react-scripts test --transformIgnorePatterns \"node_modules/(?!axios)/\" --env=jsdom --watchAll=false --coverage",
|
|
27
28
|
"eject": "react-scripts eject"
|
|
28
29
|
},
|
|
29
30
|
"eslintConfig": {
|
package/src/App.css
CHANGED
package/src/App.test.js
CHANGED
|
@@ -5,6 +5,7 @@ import Home from './components/Home';
|
|
|
5
5
|
import axios from 'axios';
|
|
6
6
|
import App from './App';
|
|
7
7
|
import CoffeeCarousel from './components/CoffeeCarousel';
|
|
8
|
+
import ControlledCarousel from './components/ControlledCarousel';
|
|
8
9
|
import CoffeeHome from './components/CoffeeHome';
|
|
9
10
|
import Donate from './components/Donate';
|
|
10
11
|
import NotFound from './components/NotFound';
|
|
@@ -14,6 +15,7 @@ import RepoDetails from './components/RepoDetails';
|
|
|
14
15
|
import RepoIssues from './components/RepoIssues';
|
|
15
16
|
import LoadingSpinner from './LoadingSpinner';
|
|
16
17
|
import AppNavBar from './AppNavbar';
|
|
18
|
+
import About from './components/About';
|
|
17
19
|
import Footer from './Footer';
|
|
18
20
|
|
|
19
21
|
// Mocking axios
|
|
@@ -103,6 +105,60 @@ describe('Home', () => {
|
|
|
103
105
|
});
|
|
104
106
|
});
|
|
105
107
|
|
|
108
|
+
describe('About Component', () => {
|
|
109
|
+
test('renders with default props', () => {
|
|
110
|
+
render(<About />);
|
|
111
|
+
|
|
112
|
+
expect(screen.getByAltText("View Conor Heffron's profile on LinkedIn")).toBeInTheDocument();
|
|
113
|
+
expect(screen.getByAltText('Strava')).toBeInTheDocument();
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
test('renders with provided props', () => {
|
|
117
|
+
const props = {
|
|
118
|
+
link: 'https://example.com',
|
|
119
|
+
imgSrc: 'https://example.com/image.png',
|
|
120
|
+
imgAlt: 'Example Image',
|
|
121
|
+
stravaLink: 'https://example.com/strava',
|
|
122
|
+
stravaImgSrc: 'https://example.com/strava-image.png',
|
|
123
|
+
stravaImgAlt: 'Example Strava',
|
|
124
|
+
};
|
|
125
|
+
render(<About {...props} />);
|
|
126
|
+
expect(screen.getByAltText('Example Image')).toBeInTheDocument();
|
|
127
|
+
expect(screen.getByAltText('Example Strava')).toBeInTheDocument();
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
describe('ControlledCarousel Component', () => {
|
|
132
|
+
const items = [
|
|
133
|
+
{
|
|
134
|
+
link: 'https://example.com',
|
|
135
|
+
img: 'https://example.com/image.png',
|
|
136
|
+
alt: 'Example Image',
|
|
137
|
+
title: 'Example Title',
|
|
138
|
+
description: 'Example Description',
|
|
139
|
+
techStack: 'Example TechStack',
|
|
140
|
+
},
|
|
141
|
+
];
|
|
142
|
+
|
|
143
|
+
test('renders with default props', () => {
|
|
144
|
+
render(<ControlledCarousel items={items} />);
|
|
145
|
+
expect(screen.getByAltText('Example Image')).toBeInTheDocument();
|
|
146
|
+
expect(screen.getByText('Example Title')).toBeInTheDocument();
|
|
147
|
+
expect(screen.getByText('Example Description')).toBeInTheDocument();
|
|
148
|
+
expect(screen.getByText('Example TechStack')).toBeInTheDocument();
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
test('renders carousel items', () => {
|
|
152
|
+
render(<ControlledCarousel items={items} />);
|
|
153
|
+
items.forEach((item) => {
|
|
154
|
+
expect(screen.getByAltText(item.alt)).toBeInTheDocument();
|
|
155
|
+
expect(screen.getByText(item.title)).toBeInTheDocument();
|
|
156
|
+
expect(screen.getByText(item.description)).toBeInTheDocument();
|
|
157
|
+
expect(screen.getByText(item.techStack)).toBeInTheDocument();
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
|
|
106
162
|
describe('CoffeeCarousel', () => {
|
|
107
163
|
test('renders carousel with coffee items', () => {
|
|
108
164
|
render(<CoffeeCarousel items={coffeeItems} />);
|
package/src/components/Donate.js
CHANGED
|
@@ -86,6 +86,19 @@ const donateItems = [
|
|
|
86
86
|
life-saving results and is more cost-effective in the long run.`,
|
|
87
87
|
founded: 1969,
|
|
88
88
|
phone: "+353 (01) 671 5551"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
donate: "https://www.debra.ie/donate/",
|
|
92
|
+
link: "https://www.debra.ie/",
|
|
93
|
+
img: red,
|
|
94
|
+
alt: "red7",
|
|
95
|
+
name: "Debra Ireland",
|
|
96
|
+
overview: `We are dedicated to transforming the lives of people living with Epidermolysis Bullosa (EB), caring for someone with EB, or bereaved by EB, through care,
|
|
97
|
+
research and advocacy. EB is an incurable genetic condition that affects the body's largest organ; the skin. People living with EB are missing the
|
|
98
|
+
essential proteins that bind the skin's layers together, so any minor friction, movement or trauma causes it to break, tear, and blister.
|
|
99
|
+
It is as fragile as a butterfly wing. That's why we're here. To be a positive force for all those living with EB and all whose lives have been impacted by EB.`,
|
|
100
|
+
founded: 1988,
|
|
101
|
+
phone: "+353 (0)1 4126924"
|
|
89
102
|
}
|
|
90
103
|
];
|
|
91
104
|
|