Skip to content

Commit

Permalink
add more assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinjude committed Oct 23, 2022
1 parent 70a4ec3 commit 6ba4193
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
14 changes: 13 additions & 1 deletion integration-tests/artifacts/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,24 @@ function assertHTMLCorrectness(runNumber) {
)
})

it(`html stitched correct and up to date slice`, () => {
it(`uses correct slice when a slice id changes in createPage mappping`, () => {
expect(htmlContent).toContain(
runNumber < 2 ? `Kyle Mathews` : `Josh Johnson`
)
})

it(`html stitched correctly and slice is up to date`, () => {
expect(htmlContent).toContain(
runNumber < 2
? `Gatsby Slice Test (before edit)`
: `Gatsby Slice Test (after edit)`
)

expect(htmlContent).toContain(
runNumber < 2
? `who lives and works in San Francisco building useful things(before edit)`
: `who lives and works in San Francisco building useful things(after edit)`
)
})
})
}
Expand Down
8 changes: 5 additions & 3 deletions integration-tests/artifacts/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ exports.sourceNodes = ({

createNodeHelper(`SliceBlogPost`, {
id: "blog-1",
authorId: `kylem`,
authorId: runNumber < 2 ? `kylem` : `joshj`,
title: "What is Lorem Ipsum?",
content:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum",
Expand Down Expand Up @@ -170,14 +170,16 @@ exports.sourceNodes = ({
createNodeHelper(`SliceBlogPostAuthor`, {
name: `Kyle Mathews`,
id: `kylem`,
summary: `who lives and works in San Francisco building useful things.`,
summary:
runNumber < 2
? `who lives and works in San Francisco building useful things(before edit).`
: `who lives and works in San Francisco building useful things(after edit).`,
twitter: `kylemathews`,
})

createNodeHelper(`SliceBlogPostAuthor`, {
name: `Josh Johnson`,
id: `joshj`,
summary: `who lives and works in Michigan building neat things.`,
twitter: `0xJ05H`,
})

Expand Down

0 comments on commit 6ba4193

Please sign in to comment.