Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lesson 2: "Product has base fields" test is flawed #10

Open
nmampersand opened this issue Nov 4, 2019 · 1 comment
Open

Lesson 2: "Product has base fields" test is flawed #10

nmampersand opened this issue Nov 4, 2019 · 1 comment

Comments

@nmampersand
Copy link

nmampersand commented Nov 4, 2019

Test "Product has base fields" tests only that the included fields are the right type and not that all required fields are present. Due to this, the test will still pass even though the Product schema is missing some fields like description or createdBy.

type Product {
name: String!
price: Float!
image: String!
type: ProductType!
range: String
liquidCooled: Boolean
bikeType: BikeType
}
...

RUNS src/types/product/tests/product.type.spec.js
PASS src/types/product/tests/product.type.spec.jsec.js
Product schema
lesson-2:
✓ Product has base fields (366ms)
✓ NewProductInput has correct fields (15ms)
✓ UpdateProductInput has correct fields (10ms)
✓ product query (45ms)
✓ products query (18ms)
✓ newProduct mutation (22ms)
✓ updateProduct mutation (19ms)
✓ removeProduct mutation (15ms)

@nmampersand nmampersand changed the title Lesson 2: "Product has base fields" doesn Lesson 2: "Product has base fields" test is flawed Nov 4, 2019
@nmampersand
Copy link
Author

Planning to open a PR shortly with a suggested fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant