Skip to content

Commit

Permalink
Do multiple window sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Oct 24, 2020
1 parent d60385a commit 6660374
Show file tree
Hide file tree
Showing 17 changed files with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions e2e-tests/visual-regression/cypress/integration/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,21 @@ const testCases = [
["constrained image", "/images/constrained"],
]

const sizes = ["iphone-6", "ipad-2", "macbook-13"]

describe(`GatsbyImage`, () => {
testCases.forEach(([title, path]) => {
describe(title, () => {
it(`renders correctly`, () => {
cy.visit(path).waitForRouteChange()
cy.get("[data-main-image]").should("have.css", "opacity", "1")
cy.get("#test-image").matchImageSnapshot()
sizes.forEach(size => {
testCases.forEach(([title, path]) => {
describe(`${title}`, () => {
it(`renders correctly on ${size}`, () => {
cy.viewport(size)
cy.visit(path)
// Wait for main image to load
cy.get("[data-main-image]").should("have.css", "opacity", "1")
// Wait for blur-up
cy.wait(600)
cy.get("#test-image").matchImageSnapshot()
})
})
})
})
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit 6660374

Please sign in to comment.