Skip to content

Commit

Permalink
fix(gatsby-source-wordpress): fix integration tests (#35399)
Browse files Browse the repository at this point in the history
* no need to hide this password - it's only used in docker and it's hardcoded in docker-compose.yml

* add new seed data with all plugins already activated

* change test assertions and snapshot
  • Loading branch information
TylerBarnes committed Apr 11, 2022
1 parent 316ac02 commit 9b8aadc
Show file tree
Hide file tree
Showing 4 changed files with 3,996 additions and 378 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ Array [
"id": "cG9zdDo3NzUy",
"mediaItemUrl": "http://localhost:8001/wp-content/uploads/2020/08/1003-1181x1772-1.jpg",
},
Object {
"id": "cG9zdDo3NzYw",
"mediaItemUrl": "http://localhost:8001/wp-content/uploads/2020/08/10-2500x1667-1.jpg",
},
Object {
"id": "cG9zdDo5Ng==",
"mediaItemUrl": "http://localhost:8001/wp-content/uploads/2018/10/brandon-siu-608784-unsplash-scaled.jpg",
Expand Down
4,364 changes: 3,993 additions & 371 deletions integration-tests/gatsby-source-wordpress/docker/seed/backup.sql

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe(`data resolution`, () => {

expect(data[`allWpMediaItem`].nodes).toBeTruthy()
expect(data[`allWpMediaItem`].nodes).toMatchSnapshot()
expect(data[`allWpMediaItem`].totalCount).toBe(17)
expect(data[`allWpMediaItem`].totalCount).toBe(16)

expect(data[`allWpTag`].totalCount).toBe(5)
expect(data[`allWpUser`].totalCount).toBe(1)
Expand Down Expand Up @@ -89,7 +89,7 @@ describe(`data resolution`, () => {
expect(gatsbyResult.data.allWpContentNode.nodes.length).toBe(
// we add a media item node before running our warm cache build.
// so 30 before 31 after
isWarmCache ? 31 : 30
isWarmCache ? 30 : 29
)
})

Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-source-wordpress/docs/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ If you start up docker by running `npm run docker-clean-start` at `[gatsby-monor
Alternatively, you can install the MySQL client cli for your particular OS/distribution and use the following command to create a dump in a file named `backup.sql` in your current working directory:

```bash
mysqldump --user=wordpress --password=<redacted-password> --port=3306 --host=127.0.0.1 --no-tablespaces --databases wordpress > backup.sql
mysqldump --user=wordpress --password=gtsb-wp-dckr-user --port=3306 --host=127.0.0.1 --no-tablespaces --databases wordpress > backup.sql
```

0 comments on commit 9b8aadc

Please sign in to comment.