Skip to content

Commit

Permalink
Remove obsolete snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
rhystmills committed Oct 23, 2023
1 parent 4bd1dc4 commit cf3cb8b
Show file tree
Hide file tree
Showing 12 changed files with 398 additions and 328 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"start": "webpack --mode development --config ./conf/webpack.conf.js --watch",
"build": "webpack --mode production --config ./conf/webpack.conf.js",
"test": "jest",
"test": "jest ./public/js",
"lint": "eslint public/js/** --ext .js"
},
"repository": {
Expand All @@ -20,7 +20,8 @@
"jest": {
"testPathDirs": [
"<rootDir>/public/js"
]
],
"testEnvironment": "jsdom"
},
"homepage": "https://github.com/guardian/atom-workshop",
"devDependencies": {
Expand All @@ -35,6 +36,8 @@
"eslint": "^4.12.1",
"eslint-plugin-react": "^6.9.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jsdom": "^22.1.0",
"mini-css-extract-plugin": "^2.7.6",
"react-addons-test-utils": "^15.4.2",
"react-hot-loader": "^3.1.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,3 @@ exports[`Should render 1`] = `
/>
</div>
`;

exports[`test Should render 1`] = `
<div
className="form__ group form__group--checkbox--test">
<label
className="form__label"
htmlFor="test">
test
</label>
<input
checked={true}
className="form__checkbox"
name="test"
onChange={[Function]}
type="checkbox"
value={true} />
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -63,56 +63,3 @@ exports[`Should render 1`] = `
</div>
</div>
`;

exports[`test Should render 1`] = `
<div
className="form__row">
<label
className="form__label"
htmlFor="test">
test
</label>
<div
className="form__ group form__group--checkbox--one">
<input
checked={true}
className="form__checkbox"
name="one"
onChange={[Function]}
type="checkbox"
value={true} />
<span
className="form__label form__label--checkbox">
one
</span>
</div>
<div
className="form__ group form__group--checkbox--two">
<input
checked={true}
className="form__checkbox"
name="two"
onChange={[Function]}
type="checkbox"
value={true} />
<span
className="form__label form__label--checkbox">
two
</span>
</div>
<div
className="form__ group form__group--checkbox--three">
<input
checked={false}
className="form__checkbox"
name="three"
onChange={[Function]}
type="checkbox"
value={false} />
<span
className="form__label form__label--checkbox">
three
</span>
</div>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -93,80 +93,3 @@ exports[`Should render with image when provided 1`] = `
</div>
</div>
`;

exports[`test Should render no image when none provided 1`] = `
<div
className="form__row">
<label
className="form__label"
htmlFor="test field name">
test field label
</label>
<div
className="image-select">
<button
className="image-select__button"
onClick={[Function]}
type="button">
+ Add Image from Grid
</button>
</div>
</div>
`;

exports[`test Should render with image when provided 1`] = `
<div
className="form__row">
<label
className="form__label"
htmlFor="test field name">
test field label
</label>
<div
className="image-select">
<div
className="image-select__image-display">
<div
className="image-select__image">
<img
src="https://s3-eu-west-1.amazonaws.com/media-origin.test.dev-guim.co.uk/5dfc898f6866c8bb4224b65b9aae89e6eb7af30f/783_0_2025_1215/1000.jpg" />
</div>
<div
className="image-select__image-details">
<div
className="image-select__image-details__detail">
<a
href="https://media.test.dev-gutools.co.uk/images/5dfc898f6866c8bb4224b65b9aae89e6eb7af30f"
target="_blank">
View image in the Grid
</a>
</div>
<div
className="image-select__image-details__detail">
Size:
957.37 KB
</div>
<div
className="image-select__image-details__detail">
Dimensions:
2025
x
1215
</div>
<button
className="image-select__button image-select__replace-button"
onClick={[Function]}
type="button">
Replace Image
</button>
<button
className="image-select__remove-button btn--red"
onClick={[Function]}
type="button">
Remove Image
</button>
</div>
</div>
</div>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,3 @@ exports[`Should render 1`] = `
/>
</div>
`;

exports[`test Should render 1`] = `
<div
className="form__row">
<label
className="form__label"
htmlFor="test">
test
</label>
<input
className="form__field"
id="test"
onChange={[Function]}
placeholder=""
type="number"
value={1} />
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -46,42 +46,3 @@ exports[`Should render 1`] = `
</div>
</div>
`;

exports[`test Should render 1`] = `
<div
className="form__row">
<label
className="form__label"
htmlFor="test">
test
</label>
<div
className="form__group--radio">
<input
checked={false}
className="form__radio-btn"
name="test"
onChange={[Function]}
type="radio"
value="One" />
<span
className="form__label form__label--radio">
One
</span>
</div>
<div
className="form__group--radio">
<input
checked={false}
className="form__radio-btn"
name="test"
onChange={[Function]}
type="radio"
value="Two" />
<span
className="form__label form__label--radio">
Two
</span>
</div>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,3 @@ exports[`Should render 1`] = `
</select>
</div>
`;

exports[`test Should render 1`] = `
<div
className="form__row">
<label
className="form__label"
htmlFor="test">
test
</label>
<select
className="form__field form__field--select"
onChange={[Function]}
value="test">
<option
value="test">
test
</option>
<option
value="test1">
test1
</option>
</select>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,3 @@ exports[`Should render 1`] = `
/>
</div>
`;

exports[`test Should render 1`] = `
<div
className="form__row">
<label
className="form__label"
htmlFor="test">
test
</label>
<input
className="form__field "
id="test"
onChange={[Function]}
placeholder=""
type="text"
value="test" />
</div>
`;
24 changes: 0 additions & 24 deletions public/js/components/Utilities/__snapshots__/Modal.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,3 @@ exports[`Should render contents when open 1`] = `
`;

exports[`Should render null when closed 1`] = `null`;

exports[`test Should render contents when open 1`] = `
<div
className="modal"
onClick={[Function]}>
<div
className="modal__content"
onClick={[Function]}>
<div
className="modal__content__header">
<button
className="i-cross modal__dismiss"
onClick={[Function]}>
Close
</button>
</div>
<div>
Modal Contents
</div>
</div>
</div>
`;

exports[`test Should render null when closed 1`] = `null`;
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,3 @@ exports[`it should render 1`] = `
</div>
</div>
`;

exports[`test it should render 1`] = `
<div>
<div
className="form__message">
<p
className="form__message__text form__message__text--error">
Error:
test
</p>
<p
className="form__message__text form__message__text--error">
Message:
This is a test
</p>
</div>
<div
className="form__message">
<p
className="form__message__text form__message__text--error">
Error:
test2
</p>
<p
className="form__message__text form__message__text--error">
Message:
This is a test
</p>
</div>
</div>
`;
11 changes: 6 additions & 5 deletions public/js/util/validateField.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ test('Should return "testing" error', () => {

});

test('Should throw on incorrectly formatted error', () => {
test('Should throw on incorrectly formatted error', async () => {
let failFunc = () => false,
fieldValue = 'test',
isRequired = false,
customValidation = [failFunc];

return validateField(fieldValue, isRequired, customValidation)
.then(res => {
expect(res).toThrow();
});
try {
await validateField(fieldValue, isRequired, customValidation)

Check failure on line 47 in public/js/util/validateField.spec.js

View workflow job for this annotation

GitHub Actions / ci

Missing semicolon
} catch (e) {
expect.anything(e)

Check failure on line 49 in public/js/util/validateField.spec.js

View workflow job for this annotation

GitHub Actions / ci

Missing semicolon
}
});

0 comments on commit cf3cb8b

Please sign in to comment.