Skip to content

Commit

Permalink
Merge pull request #1164 from MHRA/update-learning-site-packages
Browse files Browse the repository at this point in the history
Update learning site packages
  • Loading branch information
gilbertsak authored May 26, 2022
2 parents 4a8473c + 4d5bf7c commit 0108c19
Show file tree
Hide file tree
Showing 34 changed files with 8,831 additions and 11,361 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/learning-web-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup node.js
uses: actions/setup-node@v1
with:
node-version: "13.11"
node-version: "14.17"

- name: Install modules
working-directory: learning/web
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/learning-web-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup node.js
uses: actions/setup-node@v1
with:
node-version: "13.11"
node-version: "14.17"

- name: Install modules
working-directory: learning/web
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/learning-web-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup node.js
uses: actions/setup-node@v1
with:
node-version: "13.11"
node-version: "14.17"

- name: Install modules
working-directory: learning/web
Expand Down
2 changes: 1 addition & 1 deletion learning/web/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v12.13.1
v14.17.0
21 changes: 21 additions & 0 deletions learning/web/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
presets: [
"@babel/preset-react",
[
"@babel/preset-env",
{
targets: {
node: "current",
},
},
],
],
plugins: [
[
"@babel/plugin-proposal-private-property-in-object",
{
loose: true,
},
],
],
}
1 change: 0 additions & 1 deletion learning/web/config/__mocks__/gatsby.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const React = require("react")
const gatsby = jest.requireActual("gatsby")

module.exports = {
...gatsby,
graphql: jest.fn(),
Expand Down
4 changes: 0 additions & 4 deletions learning/web/config/enzyme.js

This file was deleted.

3 changes: 1 addition & 2 deletions learning/web/config/jest-preprocess.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const babelOptions = {
presets: ["babel-preset-gatsby"],
}

module.exports = require("babel-jest").createTransformer(babelOptions)
module.exports = require("babel-jest").default.createTransformer(babelOptions)
19 changes: 10 additions & 9 deletions learning/web/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@ module.exports = {
transform: {
"^.+\\.jsx?$": `<rootDir>/config/jest-preprocess.js`,
},
moduleNameMapper: {
".+\\.(css|styl|less|sass|scss)$": `identity-obj-proxy`,
".+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": `<rootDir>/config/file-mock.js`,
},
testPathIgnorePatterns: [
`node_modules`,
`\\.cache`,
`<rootDir>.*/public`,
`<rootDir>/cypress`,
],
transformIgnorePatterns: [`node_modules/(?!(gatsby)/)`],
transformIgnorePatterns: [`node_modules/(?!(gatsby|gatsby-script|uuid)/)`],
moduleNameMapper: {
".+\\.(css|styl|less|sass|scss)$": `identity-obj-proxy`,
".+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": `<rootDir>/config/file-mock.js`,
},
testEnvironmentOptions: {
url: `http://localhost`,
},
testEnvironment: "jsdom",
globals: {
__PATH_PREFIX__: ``,
},
roots: ["<rootDir>/src/", "<rootDir>/config/"],
testURL: `http://localhost`,
setupFiles: [`<rootDir>/config/loadershim.js`, "<rootDir>/config/enzyme.js"],
snapshotSerializers: ["enzyme-to-json/serializer"],
setupFiles: [`<rootDir>/config/loadershim.js`],
}
90 changes: 45 additions & 45 deletions learning/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,58 +8,58 @@
"url": "https://github.com/MHRA/gatsby/issues"
},
"dependencies": {
"@mdx-js/mdx": "^1.6.18",
"@mdx-js/react": "^1.6.18",
"babel-plugin-styled-components": "^1.11.1",
"gatsby": "^2.24.68",
"gatsby-image": "^2.4.21",
"@mdx-js/mdx": "v1",
"@mdx-js/react": "v1",
"babel-plugin-styled-components": "^2.0.7",
"gatsby": "^4.15.1",
"gatsby-image": "^3.11.0",
"gatsby-plugin-csp": "^1.1.3",
"gatsby-plugin-manifest": "^2.4.34",
"gatsby-plugin-mdx": "^1.2.44",
"gatsby-plugin-offline": "^3.2.31",
"gatsby-plugin-react-helmet": "^3.3.13",
"gatsby-plugin-sharp": "^2.6.39",
"gatsby-plugin-sitemap": "^2.4.15",
"gatsby-plugin-styled-components": "^3.3.13",
"gatsby-plugin-typography": "^2.5.13",
"gatsby-remark-copy-linked-files": "^2.3.19",
"gatsby-remark-images": "^3.3.33",
"gatsby-remark-prismjs": "^3.5.16",
"gatsby-remark-responsive-iframe": "^2.4.17",
"gatsby-remark-smartypants": "^2.3.13",
"gatsby-source-filesystem": "^2.3.33",
"gatsby-transformer-json": "^2.4.14",
"gatsby-transformer-remark": "^2.8.38",
"gatsby-transformer-sharp": "^2.5.17",
"prismjs": "^1.21.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-ga": "^3.1.2",
"gatsby-plugin-manifest": "^4.15.0",
"gatsby-plugin-mdx": "^3.15.0",
"gatsby-plugin-offline": "^5.15.0",
"gatsby-plugin-react-helmet": "^5.15.0",
"gatsby-plugin-sharp": "^4.15.0",
"gatsby-plugin-sitemap": "^5.15.0",
"gatsby-plugin-styled-components": "^5.15.0",
"gatsby-plugin-typography": "^4.15.0",
"gatsby-remark-copy-linked-files": "^5.15.0",
"gatsby-remark-images": "^6.15.0",
"gatsby-remark-prismjs": "^6.15.0",
"gatsby-remark-responsive-iframe": "^5.15.0",
"gatsby-remark-smartypants": "^5.15.0",
"gatsby-source-filesystem": "^4.15.0",
"gatsby-transformer-json": "^4.15.0",
"gatsby-transformer-remark": "^5.15.0",
"gatsby-transformer-sharp": "^4.15.0",
"prismjs": "^1.28.0",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-ga": "^3.3.0",
"react-gtm-module": "^2.0.11",
"react-helmet": "^6.1.0",
"react-icons": "^3.11.0",
"react-typography": "^0.16.19",
"styled-components": "^5.2.0",
"typeface-merriweather": "0.0.72",
"typeface-montserrat": "0.0.75",
"typography": "^0.16.19",
"react-icons": "^4.3.1",
"react-typography": "^0.16.20",
"styled-components": "^5.3.5",
"typeface-merriweather": "1.1.13",
"typeface-montserrat": "1.1.13",
"typography": "^0.16.21",
"universal-cookie": "^4.0.4",
"uuid": "^8.3.1"
"uuid": "^8.3.2"
},
"devDependencies": {
"babel-jest": "^26.5.0",
"babel-preset-gatsby": "^0.5.13",
"cypress": "^5.3.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
"enzyme-to-json": "^3.6.1",
"@babel/plugin-proposal-private-property-in-object": "^7.17.12",
"@babel/preset-react": "^7.17.12",
"babel-jest": "^28.1.0",
"babel-preset-gatsby": "^2.15.0",
"cypress": "^9.7.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.5.0",
"minimatch": "^3.0.4",
"pa11y-ci": "^2.4.0",
"prettier": "^2.1.2",
"react-test-renderer": "^16.13.1",
"wait-on": "^5.2.0"
"jest": "^28.1.0",
"jest-environment-jsdom": "^28.1.0",
"minimatch": "^5.1.0",
"pa11y-ci": "^3.0.1",
"prettier": "^2.6.2",
"react-test-renderer": "^18.1.0",
"wait-on": "^6.0.1"
},
"homepage": "https://github.com/MHRA/products#readme",
"keywords": [
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`CookieBanner should render 🍪 1`] = `" "`;
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
/**
* @jest-environment jsdom
*/

import React from "react"
import CookieBanner from "./index"
import { shallow } from "enzyme"
import renderer from 'react-test-renderer';

describe(CookieBanner, () => {
it("should render 🍪", () => {
const component = shallow(<CookieBanner />)
const component = renderer.create(<CookieBanner />).toJSON()
expect(component).toMatchSnapshot()
})
})

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Expander should render 1`] = `
<div
className="sc-bczRLJ dOVkPd"
>
<button
className="sc-gsnTZi fnbOwy"
onClick={[Function]}
title="expand"
>
Hola
</button>
<div
className="sc-hKMtZM ijoscT hidden"
>
<button
className="sc-dkzDqf grguyE"
onClick={[Function]}
title="close"
>
<svg
fill="currentColor"
height="1em"
stroke="currentColor"
strokeWidth="0"
style={
Object {
"color": undefined,
}
}
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0 0h24v24H0z"
fill="none"
/>
<path
d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
/>
</svg>
</button>
</div>
</div>
`;
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from "react"
import Expander from "./index"
import { shallow } from "enzyme"
import renderer from "react-test-renderer"

describe(Expander, () => {
it("should render", () => {
const component = shallow(<Expander title={"Hola"} children={<></>} />)
const component = renderer.create(<Expander title={"Hola"} children={<></>} />)
.toJSON()
expect(component).toMatchSnapshot()
})
})

This file was deleted.

Loading

0 comments on commit 0108c19

Please sign in to comment.