@conorheffron/ironoc-frontend 7.5.4 → 7.5.6

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/package.json CHANGED
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "name": "@conorheffron/ironoc-frontend",
3
- "version": "7.5.4",
3
+ "version": "7.5.6",
4
4
  "private": false,
5
5
  "license": "GPL-3.0-or-later",
6
6
  "dependencies": {
7
7
  "@apollo/client": "^3.13.8",
8
+ "@emotion/is-prop-valid": "^1.3.1",
9
+ "@emotion/react": "^11.14.0",
10
+ "@emotion/styled": "^11.14.1",
8
11
  "@fontsource/montserrat": "^5.1.1",
9
12
  "@fontsource/open-sans": "^5.1.1",
10
13
  "@graphiql/plugin-explorer": "^5.0.0",
14
+ "@graphiql/react": "^0.35.4",
11
15
  "@testing-library/user-event": "^13.5.0",
12
16
  "axios": "^1.8.2",
13
17
  "bootstrap": "5.1",
@@ -15,10 +15,10 @@ function isValidUrl(url) {
15
15
  class CoffeeCarousel extends Component {
16
16
  render() {
17
17
  const { items } = this.props;
18
-
19
- // Only include items with a valid http/https URL
20
- const validItems = items.filter(item => isValidUrl(item.image));
21
-
18
+ // Only include items that are not null/undefined and have a valid http/https URL
19
+ const validItems = (items || []).filter(
20
+ item => item && isValidUrl(item.image)
21
+ );
22
22
  return (
23
23
  <Carousel className="App-header">
24
24
  {validItems.map((item, index) => (
@@ -49,6 +49,7 @@ describe('CoffeeCarousel', () => {
49
49
  title: 'Coffee with null ingredients',
50
50
  ingredients: null,
51
51
  },
52
+ null
52
53
  ];
53
54
 
54
55
  render(<CoffeeCarousel items={mockItems} />);