Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Port over MockRelayRendererFixtures, renderWithLoadProgress tests
  • Loading branch information
javamonn committed Oct 31, 2018
commit 89c5202b7ea878adeee98855f8457fe7e70276e3
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"parse5": "5.1.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This resolution does not appear to be necessary anymore. Original discussion here: https://github.com/artsy/emission/pull/1185/files#r217160876

"graphql": "^0.13",
"relay-runtime": "https://github.com/alloy/relay/releases/download/v1.5.0-artsy.5/relay-runtime-1.5.0-artsy.5.tgz",
"@types/relay-runtime": "^1.3.5"
"@types/relay-runtime": "^1.3.5",
"cheerio": "0.22.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

jest-environment-jsdom depends on cheerio@^1.0.0-rc.2. I ran into a serialization error with this version, where <Image /> elements rendered to string would be transformed into <img> instead of the expected <image />:

 renderRelayTree › resolves a promise once the full tree (including nested query renderers) has been rendered

    expect(received).toEqual(expected)

    Expected value to equal:
      "<view><img source=\"[object Object]\"><text ellipsizemode=\"tail\">Mona Lisa</text><text ellipsizemode=\"tail\">Leonardo da Vinci</text></view>"
    Received:
      "<view><image source=\"[object Object]\"></image><text ellipsizemode=\"tail\">Mona Lisa</text><text ellipsizemode=\"tail\">Leonardo da Vinci</text></view>"

My hunch is that enzyme must be passing slightly different configuration options down to cheerio when calling render vs mount, but not sure. Resolving to the latest non-rc cheerio version fixes this, but does appear to be a hack.

},
"dependencies": {
"@artsy/palette": "^2.11.0",
Expand Down
122 changes: 122 additions & 0 deletions src/__generated__/MockRelayRendererFixturesArtistQuery.graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

159 changes: 159 additions & 0 deletions src/__generated__/MockRelayRendererFixturesBadQuery.graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading