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

test(contentful): improve content reference snapshot tests #31008

Merged
merged 1 commit into from
Apr 23, 2021

Conversation

axe312ger
Copy link
Collaborator

Our content reference tests are the only once that snapshot the text instead of the DOM. As DOM comparison with @cypress/snapshot is way more efficient when tests fail, this rewrites the tests.

It also aligns the query to actually contain all available references.

This will help to reliable test and simplify #30855 && #31007

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Apr 22, 2021
},
"content-reference-many-loop-a-greater-b": {
"1": "Content Reference: Many (Loop A -> B)[ContentfulInteger] 42[ContentfulText] The quick brown fox jumps over the lazy dog.[ContentfulReference] Content Reference: Many (Loop B -> A): [Content Reference: Many (Loop A -> B)]"
"1": "<div data-cy-id=\"content-reference-many-loop-a-greater-b\">\n <h2>Content Reference: Many (Loop A -&gt; B)</h2>\n <p data-cy-id=\"integer\">[ContentfulInteger] 42</p>\n <p data-cy-id=\"text\">[ContentfulText] The quick brown fox jumps over the lazy\n dog.</p>\n <p data-cy-id=\"reference\">[ContentfulReference] Content Reference: Many (Loop\n B -&gt; A): [Number: Integer, Text: Short, Content Reference: Many (Loop A\n -&gt; B)]</p>\n</div>"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Number: Integer, Text: Short, These references actually have been missing from the query. The others PR's brought this to the surface.

@axe312ger axe312ger added status: needs core review Currently awaiting review from Core team member topic: source-contentful Related to Gatsby's integration with Contentful and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Apr 22, 2021
@LekoArts LekoArts merged commit 9a4d1ae into master Apr 23, 2021
@LekoArts LekoArts deleted the test/contentful-e2e-improve-reference-tests branch April 23, 2021 09:21
@axe312ger
Copy link
Collaborator Author

Thank you @LekoArts !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs core review Currently awaiting review from Core team member topic: source-contentful Related to Gatsby's integration with Contentful
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants