Skip to content

Commit 51cf5a6

Browse files
authored
Merge pull request #279 from Asjas/update-testing-utils
Update testing utils
2 parents f84266d + 8a658db commit 51cf5a6

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

finished-application/frontend/components/CreateProduct.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ const CREATE_PRODUCT_MUTATION = gql`
3434
export default function CreateProduct() {
3535
const { inputs, handleChange, clearForm, resetForm } = useForm({
3636
image: '',
37-
name: 'Nice Shoes',
38-
price: 34234,
39-
description: 'These are the best shoes!',
37+
name: '',
38+
price: 0,
39+
description: '',
4040
});
4141
const [createProduct, { loading, error, data }] = useMutation(
4242
CREATE_PRODUCT_MUTATION,
@@ -108,3 +108,5 @@ export default function CreateProduct() {
108108
</Form>
109109
);
110110
}
111+
112+
export { CREATE_PRODUCT_MUTATION };

finished-application/frontend/lib/testUtils.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const fakeItem = () => ({
1010
price: 5000,
1111
user: null,
1212
photo: {
13+
id: 'abc123',
14+
altText: 'dogs are best',
1315
image: {
1416
publicUrlTransformed: 'dog.jpg',
1517
},

sick-fits/frontend/lib/testUtils.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const fakeItem = () => ({
1010
price: 5000,
1111
user: null,
1212
photo: {
13+
id: 'abc123',
14+
altText: 'dogs are best',
1315
image: {
1416
publicUrlTransformed: 'dog.jpg',
1517
},

0 commit comments

Comments
 (0)