Increase Max height / width to 8000px (#5882)

This commit is contained in:
Brendan McGinn
2019-12-05 17:17:07 +00:00
committed by Jennifer Shehane
parent 13aa496476
commit d0eef76208
3 changed files with 9 additions and 9 deletions

View File

@@ -159,7 +159,7 @@ module.exports = (Commands, Cypress, cy, state, config) ->
widthAndHeightAreWithinBounds = (width, height) ->
_.every [width, height], (val) ->
val >= 20 and val <= 4000
val >= 20 and val <= 8000
switch
when _.isString(presetOrWidth) and _.isBlank(presetOrWidth)

View File

@@ -1030,7 +1030,7 @@ module.exports = {
viewport:
bad_args: "#{cmd('viewport')} can only accept a string preset or a width and height as numbers."
dimensions_out_of_range: "#{cmd('viewport')} width and height must be between 20px and 4000px."
dimensions_out_of_range: "#{cmd('viewport')} width and height must be between 20px and 8000px."
empty_string: "#{cmd('viewport')} cannot be passed an empty string."
invalid_orientation: "#{cmd('viewport')} can only accept '{{all}}' as valid orientations. Your orientation was: '{{orientation}}'"
missing_preset: "#{cmd('viewport')} could not find a preset for: '{{preset}}'. Available presets are: {{presets}}"

View File

@@ -640,7 +640,7 @@ describe "src/cy/commands/window", ->
it "throws when passed negative numbers", (done) ->
cy.on "fail", (err) =>
expect(@logs.length).to.eq(1)
expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 4000px."
expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 8000px."
done()
cy.viewport(800, -600)
@@ -648,7 +648,7 @@ describe "src/cy/commands/window", ->
it "throws when passed width less than 20", (done) ->
cy.on "fail", (err) =>
expect(@logs.length).to.eq(1)
expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 4000px."
expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 8000px."
done()
cy.viewport(19, 600)
@@ -656,16 +656,16 @@ describe "src/cy/commands/window", ->
it "does not throw when passed width equal to 20", ->
cy.viewport(20, 600)
it "throws when passed height greater than than 4000", (done) ->
it "throws when passed height greater than than 8000", (done) ->
cy.on "fail", (err) =>
expect(@logs.length).to.eq(1)
expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 4000px."
expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 8000px."
done()
cy.viewport(1000, 4001)
cy.viewport(1000, 8001)
it "does not throw when passed width equal to 4000", ->
cy.viewport(200, 4000)
it "does not throw when passed width equal to 8000", ->
cy.viewport(200, 8000)
it "throws when passed an empty string as width", (done) ->
cy.on "fail", (err) =>