From 2e61c3bebcdbb61b34db21e21536db92bca57146 Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Thu, 20 Feb 2020 17:14:49 +0630 Subject: [PATCH 1/4] remove 'electron' as known browser family during validation error. --- packages/server/__snapshots__/3_config_spec.coffee.js | 2 +- packages/server/__snapshots__/validation_spec.coffee.js | 2 +- packages/server/lib/util/validation.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/server/__snapshots__/3_config_spec.coffee.js b/packages/server/__snapshots__/3_config_spec.coffee.js index f018a48397d5..5cf74ef9a6f4 100644 --- a/packages/server/__snapshots__/3_config_spec.coffee.js +++ b/packages/server/__snapshots__/3_config_spec.coffee.js @@ -149,6 +149,6 @@ Expected \`viewportWidth\` to be a number. Instead the value was: \`"foo"\` exports['e2e config catches invalid browser in the configuration file 1'] = ` We found an invalid value in the file: \`cypress.json\` -Found an error while validating the \`browsers\` list. Expected \`family\` to be either electron, chromium or firefox. Instead the value was: \`{"name":"bad browser","family":"unknown family","displayName":"Bad browser","version":"no version","path":"/path/to","majorVersion":123}\` +Found an error while validating the \`browsers\` list. Expected \`family\` to be either chromium or firefox. Instead the value was: \`{"name":"bad browser","family":"unknown family","displayName":"Bad browser","version":"no version","path":"/path/to","majorVersion":123}\` ` diff --git a/packages/server/__snapshots__/validation_spec.coffee.js b/packages/server/__snapshots__/validation_spec.coffee.js index 915050e0f60b..e759950b6414 100644 --- a/packages/server/__snapshots__/validation_spec.coffee.js +++ b/packages/server/__snapshots__/validation_spec.coffee.js @@ -71,7 +71,7 @@ exports['lib/util/validation #isValidBrowser passes valid browsers and forms err "displayName": "Bad family browser", "family": "unknown family" }, - "expect": "Expected `family` to be either electron, chromium or firefox. Instead the value was: `{\"name\":\"bad family\",\"displayName\":\"Bad family browser\",\"family\":\"unknown family\"}`" + "expect": "Expected `family` to be either chromium or firefox. Instead the value was: `{\"name\":\"bad family\",\"displayName\":\"Bad family browser\",\"family\":\"unknown family\"}`" } ] } diff --git a/packages/server/lib/util/validation.js b/packages/server/lib/util/validation.js index e7c2b34f1abf..1f12840f4af3 100644 --- a/packages/server/lib/util/validation.js +++ b/packages/server/lib/util/validation.js @@ -48,7 +48,7 @@ const isValidBrowser = (browser) => { } // TODO: this is duplicated with browsers/index - const knownBrowserFamilies = ['electron', 'chromium', 'firefox'] + const knownBrowserFamilies = ['chromium', 'firefox'] if (!is.oneOf(knownBrowserFamilies)(browser.family)) { return errMsg('family', browser, commaListsOr`either ${knownBrowserFamilies}`) From 2c7244b4b63adc0ffbe17f9342766095bc1e90fa Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Thu, 20 Feb 2020 17:45:18 +0630 Subject: [PATCH 2/4] fix tests that had unexpected results because fixture has invalid family name set --- packages/server/__snapshots__/validation_spec.coffee.js | 2 +- packages/server/test/unit/config_spec.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/__snapshots__/validation_spec.coffee.js b/packages/server/__snapshots__/validation_spec.coffee.js index e759950b6414..3afe26c53761 100644 --- a/packages/server/__snapshots__/validation_spec.coffee.js +++ b/packages/server/__snapshots__/validation_spec.coffee.js @@ -61,7 +61,7 @@ exports['lib/util/validation #isValidBrowser passes valid browsers and forms err { "given": { "name": "No display name", - "family": "electron" + "family": "chromium" }, "expect": "Expected `displayName` to be a non-empty string. Instead the value was: `{\"name\":\"No display name\",\"family\":\"electron\"}`" }, diff --git a/packages/server/test/unit/config_spec.coffee b/packages/server/test/unit/config_spec.coffee index 9de786ad085d..170aef974864 100644 --- a/packages/server/test/unit/config_spec.coffee +++ b/packages/server/test/unit/config_spec.coffee @@ -1123,7 +1123,7 @@ describe "lib/config", -> } browserTwo = { name: "fake electron", - family: "electron", + family: "chromium", displayName: "Electron", version: "x.y.z", # Electron browser is built-in, no external path From 4a3389a5b216fcbdc20b210ec2932c9be4b124ea Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Thu, 20 Feb 2020 17:55:44 +0630 Subject: [PATCH 3/4] whoops, missed updated one family in the spec --- packages/server/test/unit/validation_spec.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/test/unit/validation_spec.coffee b/packages/server/test/unit/validation_spec.coffee index 81521a149706..18dcdc02999d 100644 --- a/packages/server/test/unit/validation_spec.coffee +++ b/packages/server/test/unit/validation_spec.coffee @@ -42,7 +42,7 @@ describe "lib/util/validation", -> # invalid browser, missing displayName { name: "No display name", - family: "electron" + family: "chromium" }, { name: "bad family", From 6cc47eab0e9a48d14e62325e0b03d024e3531ab4 Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Thu, 20 Feb 2020 23:20:02 +0630 Subject: [PATCH 4/4] missed another snapshot change --- packages/server/__snapshots__/validation_spec.coffee.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/__snapshots__/validation_spec.coffee.js b/packages/server/__snapshots__/validation_spec.coffee.js index 3afe26c53761..31088e1130e9 100644 --- a/packages/server/__snapshots__/validation_spec.coffee.js +++ b/packages/server/__snapshots__/validation_spec.coffee.js @@ -63,7 +63,7 @@ exports['lib/util/validation #isValidBrowser passes valid browsers and forms err "name": "No display name", "family": "chromium" }, - "expect": "Expected `displayName` to be a non-empty string. Instead the value was: `{\"name\":\"No display name\",\"family\":\"electron\"}`" + "expect": "Expected `displayName` to be a non-empty string. Instead the value was: `{\"name\":\"No display name\",\"family\":\"chromium\"}`" }, { "given": {