From 4e0f39fb4e94f80a5d069e836c8388a5ad1b9dcc Mon Sep 17 00:00:00 2001 From: Michal Piechowiak Date: Thu, 10 Dec 2020 18:00:45 +0100 Subject: [PATCH 1/5] test(e2e-development-runtime): add tests for loading indicator behavior --- .../navigation/loading-indicator.js | 205 ++++++++++++++++++ .../development-runtime/gatsby-config.js | 1 + .../gatsby-node.js | 75 +++++++ .../package.json | 1 + .../src/pages/query-on-demand/no-query.js | 13 ++ .../query-on-demand/possibly-heavy-query.js | 27 +++ .../gatsby/src/utils/loading-indicator.ts | 20 +- 7 files changed, 337 insertions(+), 5 deletions(-) create mode 100644 e2e-tests/development-runtime/cypress/integration/navigation/loading-indicator.js create mode 100644 e2e-tests/development-runtime/plugins/gatsby-source-query-on-demand-data/gatsby-node.js create mode 100644 e2e-tests/development-runtime/plugins/gatsby-source-query-on-demand-data/package.json create mode 100644 e2e-tests/development-runtime/src/pages/query-on-demand/no-query.js create mode 100644 e2e-tests/development-runtime/src/pages/query-on-demand/possibly-heavy-query.js diff --git a/e2e-tests/development-runtime/cypress/integration/navigation/loading-indicator.js b/e2e-tests/development-runtime/cypress/integration/navigation/loading-indicator.js new file mode 100644 index 0000000000000..fb5feb487e9a2 --- /dev/null +++ b/e2e-tests/development-runtime/cypress/integration/navigation/loading-indicator.js @@ -0,0 +1,205 @@ +if (Cypress.env(`QUERY_ON_DEMAND`)) { + function toggleLoadingIndicator(command) { + cy.then(() => fetch(`/___loading-indicator/${command}/`)) + cy.wait(5000) + } + + const refresh = async payload => { + return await fetch(`/__refresh/gatsby-source-query-on-demand-data/`, { + method: `POST`, + headers: { + "Content-Type": `application/json`, + }, + body: payload ? JSON.stringify({ updateData: payload }) : undefined, + }) + } + + function assertIndicatorExists(doesExists) { + cy.get(`[data-gatsby-loading-indicator="root"]`, { timeout: 10000 }).should( + doesExists ? `exist` : `not.exist` + ) + } + + function assertIndicatorVisible(isVisible) { + cy.get(`[data-gatsby-loading-indicator="root"]`, { timeout: 10000 }).should( + isVisible ? `be.visible` : `not.be.visible` + ) + + cy.screenshot() + } + + function runTests({ + data, + sleep, + mode, + expectIndicatorEnabled, + expectIndicatorVisible, + }) { + // make sure we are not on a page with query + cy.visit(`/query-on-demand/no-query/`).waitForRouteChange() + + // setup data for page with query + cy.then(() => + refresh({ + data, + sleep, + }) + ) + + if (mode === `first-render`) { + cy.visit(`/query-on-demand/possibly-heavy-query/`) + } else if (mode === `client-navigation`) { + cy.findByTestId(`heavy-query-page-link`).click() + } else { + throw new Error( + `Unknown mode - should be one of ["first-render", "client-navigation"]` + ) + } + + // we wait for first render or for client side navigation to complete when we expect for loading indicator + // to show up (depending on test setup) + if (expectIndicatorEnabled) { + assertIndicatorExists(true) + assertIndicatorVisible(expectIndicatorVisible) + } else { + assertIndicatorExists(false) + } + + cy.waitForRouteChange() + + // once we finished first render or client side navigation - loading indicator should not be visible anymore (if it was before) + if (expectIndicatorEnabled) { + assertIndicatorExists(true) + assertIndicatorVisible(false) + } else { + assertIndicatorExists(false) + } + + // making sure our test setup was correct and expect query result is rendered + cy.findByTestId(`query-data`).should(`have.text`, data) + } + + describe(`Loading indicator`, () => { + before(async () => { + Cypress.config(`includeShadowDom`, true) + }) + + after(async () => { + toggleLoadingIndicator(`auto`) + }) + + // we disable showing loading indicator in cypress by default + // to not impact user tests - this is to make sure that's the case/catch regressions + describe(`Defaults in cypress env (doesn't show indicator)`, () => { + before(async () => { + toggleLoadingIndicator(`auto`) + }) + + describe(`Page with light/quick query doesn't show indicator`, () => { + const config = { + sleep: 0, + expectIndicatorEnabled: false, + expectIndicatorVisible: `doesn't matter because indicator should not be enabled`, + } + + it(`Initial first render`, () => { + runTests({ + ...config, + data: `quick-first-render-with-disabled-indicator`, + mode: `first-render`, + }) + }) + + it(`On navigation`, () => { + runTests({ + ...config, + data: `quick-client-navigation-with-disabled-indicator`, + mode: `client-navigation`, + }) + }) + }) + + describe(`Page with heavy/long running query doesn't show indicator (indicator is disabled)`, () => { + const config = { + sleep: 5000, + expectIndicatorEnabled: false, + expectIndicatorVisible: `doesn't matter because indicator should not be enabled`, + } + + it(`Initial first render`, () => { + runTests({ + ...config, + data: `slow-first-render-with-disabled-indicator`, + mode: `first-render`, + }) + }) + + it(`On navigation`, () => { + runTests({ + ...config, + data: `slow-client-navigation-with-disabled-indicator`, + mode: `client-navigation`, + }) + }) + }) + }) + + describe(`With enabled loading indicator`, () => { + before(async () => { + toggleLoadingIndicator(`enable`) + }) + + describe(`Page with light/quick query doesn't show indicator`, () => { + const config = { + sleep: 0, + expectIndicatorEnabled: true, + expectIndicatorVisible: false, + } + + it(`Initial first render`, () => { + runTests({ + ...config, + data: `quick-first-render-with-enabled-indicator`, + mode: `first-render`, + }) + }) + + it(`On navigation`, () => { + runTests({ + ...config, + data: `quick-client-navigation-with-enabled-indicator`, + mode: `client-navigation`, + }) + }) + }) + + describe(`Page with heavy/long running query shows indicator`, () => { + const config = { + sleep: 5000, + expectIndicatorEnabled: true, + expectIndicatorVisible: true, + } + + it(`Initial first render`, () => { + runTests({ + ...config, + data: `slow-first-render-with-enabled-indicator`, + mode: `first-render`, + }) + }) + + it(`On navigation`, () => { + runTests({ + ...config, + data: `slow-client-navigation-with-enabled-indicator`, + mode: `client-navigation`, + }) + }) + }) + }) + }) +} else { + it.skip( + `This is not running in query on demand mode, so there is not loading indicator` + ) +} diff --git a/e2e-tests/development-runtime/gatsby-config.js b/e2e-tests/development-runtime/gatsby-config.js index 186b0e809a2c0..5542043a160c8 100644 --- a/e2e-tests/development-runtime/gatsby-config.js +++ b/e2e-tests/development-runtime/gatsby-config.js @@ -27,6 +27,7 @@ module.exports = { }, `gatsby-source-fake-data`, `gatsby-source-pinc-data`, + `gatsby-source-query-on-demand-data`, `gatsby-transformer-sharp`, `gatsby-transformer-json`, { diff --git a/e2e-tests/development-runtime/plugins/gatsby-source-query-on-demand-data/gatsby-node.js b/e2e-tests/development-runtime/plugins/gatsby-source-query-on-demand-data/gatsby-node.js new file mode 100644 index 0000000000000..bf8ba397e77b9 --- /dev/null +++ b/e2e-tests/development-runtime/plugins/gatsby-source-query-on-demand-data/gatsby-node.js @@ -0,0 +1,75 @@ +const initialData = { + data: `initial`, + sleep: 0, +} + +exports.sourceNodes = async ({ + actions, + createNodeId, + createContentDigest, + webhookBody, +}) => { + const { createNode } = actions + + function doCreateNode(data) { + const id = `query-on-demand-testing-node` + + const node = { + ...data, + id: createNodeId(id), + selector: id, + internal: { + contentDigest: createContentDigest(data), + type: `QueryOnDemandMock`, + }, + } + return createNode(node) + } + + if (webhookBody && webhookBody.updateData) { + console.log( + `[query-on-demand-source] Received webhook data`, + webhookBody.updateData + ) + /* + expected shape of webhook body: + { + "updateData": { + sleep: , + data "" + } + } + */ + + let dataAfterSync = { + ...initialData, + } + if (webhookBody.updateData) { + dataAfterSync = { + ...dataAfterSync, + ...webhookBody.updateData, + } + } + + doCreateNode(dataAfterSync) + } else { + doCreateNode(initialData) + } +} + +exports.createResolvers = ({ createResolvers }) => { + createResolvers({ + QueryOnDemandMock: { + doSomeWaiting: { + type: `String`, + resolve: source => { + return new Promise(resolve => { + setTimeout(() => { + resolve(source.data) + }, source.sleep) + }) + }, + }, + }, + }) +} diff --git a/e2e-tests/development-runtime/plugins/gatsby-source-query-on-demand-data/package.json b/e2e-tests/development-runtime/plugins/gatsby-source-query-on-demand-data/package.json new file mode 100644 index 0000000000000..0967ef424bce6 --- /dev/null +++ b/e2e-tests/development-runtime/plugins/gatsby-source-query-on-demand-data/package.json @@ -0,0 +1 @@ +{} diff --git a/e2e-tests/development-runtime/src/pages/query-on-demand/no-query.js b/e2e-tests/development-runtime/src/pages/query-on-demand/no-query.js new file mode 100644 index 0000000000000..e60aecb1b88d1 --- /dev/null +++ b/e2e-tests/development-runtime/src/pages/query-on-demand/no-query.js @@ -0,0 +1,13 @@ +import React from "react" +import { Link } from "gatsby" + +export default function QODNoQuery() { + return ( + <> + + Page with heavy query + +

Hello on a page without a query

+ + ) +} diff --git a/e2e-tests/development-runtime/src/pages/query-on-demand/possibly-heavy-query.js b/e2e-tests/development-runtime/src/pages/query-on-demand/possibly-heavy-query.js new file mode 100644 index 0000000000000..58af7f17a9175 --- /dev/null +++ b/e2e-tests/development-runtime/src/pages/query-on-demand/possibly-heavy-query.js @@ -0,0 +1,27 @@ +import React from "react" +import { Link, graphql } from "gatsby" + +export default function QODHeavyQuery({ data }) { + return ( + <> + + Page with no query + +

Hello on a page with possibly heavy query

+

+ Data:{" "} + + {data.queryOnDemandMock.doSomeWaiting} + +

+ + ) +} + +export const query = graphql` + { + queryOnDemandMock { + doSomeWaiting + } + } +` diff --git a/packages/gatsby/src/utils/loading-indicator.ts b/packages/gatsby/src/utils/loading-indicator.ts index 6ecfb4cf2e2c6..9f502cf5826f9 100644 --- a/packages/gatsby/src/utils/loading-indicator.ts +++ b/packages/gatsby/src/utils/loading-indicator.ts @@ -9,23 +9,25 @@ import { writeModule } from "./gatsby-webpack-virtual-modules" // to not cause problems for users when they iterate on their E2E tests // this check could be expanded in the future to add support for more scenarios // like that. -let indicatorEnabled: "initial" | true | false | undefined = undefined +let indicatorEnabled: "auto" | true | false | undefined = undefined export function writeVirtualLoadingIndicatorModule(): void { if (indicatorEnabled === undefined) { indicatorEnabled = process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND && process.env.GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR === `true` - ? `initial` + ? `auto` : false } + console.log(`wat`, { indicatorEnabled }) + writeModule( `$virtual/loading-indicator.js`, ` export function isLoadingIndicatorEnabled() { return ${ - indicatorEnabled === `initial` + indicatorEnabled === `auto` ? `\`Cypress\` in window ? false : true` @@ -43,10 +45,18 @@ export function routeLoadingIndicatorRequests(app: Express): void { } else if (req.params.method === `disable` && indicatorEnabled !== false) { indicatorEnabled = false writeVirtualLoadingIndicatorModule() + } else if (req.params.method === `auto` && indicatorEnabled !== `auto`) { + indicatorEnabled = `auto` + writeVirtualLoadingIndicatorModule() } - res.send({ - status: indicatorEnabled ? `enabled` : `disabled`, + res.status(200).send({ + status: + indicatorEnabled === `auto` + ? `auto` + : indicatorEnabled + ? `enabled` + : `disabled`, }) }) } From abf7a04d8511c01962de37237ecc69161f75a925 Mon Sep 17 00:00:00 2001 From: Michal Piechowiak Date: Fri, 13 Nov 2020 12:50:50 +0100 Subject: [PATCH 2/5] add query on demand variant for e2e dev tests --- packages/gatsby/src/services/initialize.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gatsby/src/services/initialize.ts b/packages/gatsby/src/services/initialize.ts index a8e9f404aea35..39b385fd7eddf 100644 --- a/packages/gatsby/src/services/initialize.ts +++ b/packages/gatsby/src/services/initialize.ts @@ -233,7 +233,7 @@ export async function initialize({ // we don't want to ever have this flag enabled for anything than develop // in case someone have this env var globally set delete process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND - } else if (isCI()) { + } else if (isCI() && !process.env.CYPRESS_SUPPORT) { delete process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND reporter.verbose( `Experimental Query on Demand feature is not available in CI environment. Continuing with eager query running.` From 239d930c30b7b8a0f29f3c8b03a02e19f61bf82e Mon Sep 17 00:00:00 2001 From: Michal Piechowiak Date: Tue, 23 Feb 2021 19:33:10 +0100 Subject: [PATCH 3/5] set env var --- e2e-tests/development-runtime/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-tests/development-runtime/package.json b/e2e-tests/development-runtime/package.json index e6303130a6391..f3539d213026d 100644 --- a/e2e-tests/development-runtime/package.json +++ b/e2e-tests/development-runtime/package.json @@ -29,7 +29,7 @@ "license": "MIT", "scripts": { "build": "gatsby build", - "develop": "cross-env CYPRESS_SUPPORT=y ENABLE_GATSBY_REFRESH_ENDPOINT=true gatsby develop", + "develop": "cross-env CYPRESS_SUPPORT=y ENABLE_GATSBY_REFRESH_ENDPOINT=true GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND=y gatsby develop", "serve": "gatsby serve", "start": "npm run develop", "format": "prettier --write \"src/**/*.js\"", From 2a5fbe5ed9c756044885f0a1a4f4e4bdcde07b5d Mon Sep 17 00:00:00 2001 From: Michal Piechowiak Date: Tue, 23 Feb 2021 19:34:07 +0100 Subject: [PATCH 4/5] just run them --- .../navigation/loading-indicator.js | 328 +++++++++--------- 1 file changed, 161 insertions(+), 167 deletions(-) diff --git a/e2e-tests/development-runtime/cypress/integration/navigation/loading-indicator.js b/e2e-tests/development-runtime/cypress/integration/navigation/loading-indicator.js index fb5feb487e9a2..7ef2fe7100386 100644 --- a/e2e-tests/development-runtime/cypress/integration/navigation/loading-indicator.js +++ b/e2e-tests/development-runtime/cypress/integration/navigation/loading-indicator.js @@ -1,205 +1,199 @@ -if (Cypress.env(`QUERY_ON_DEMAND`)) { - function toggleLoadingIndicator(command) { - cy.then(() => fetch(`/___loading-indicator/${command}/`)) - cy.wait(5000) - } +function toggleLoadingIndicator(command) { + cy.then(() => fetch(`/___loading-indicator/${command}/`)) + cy.wait(5000) +} + +const refresh = async payload => { + return await fetch(`/__refresh/gatsby-source-query-on-demand-data/`, { + method: `POST`, + headers: { + "Content-Type": `application/json`, + }, + body: payload ? JSON.stringify({ updateData: payload }) : undefined, + }) +} + +function assertIndicatorExists(doesExists) { + cy.get(`[data-gatsby-loading-indicator="root"]`, { timeout: 10000 }).should( + doesExists ? `exist` : `not.exist` + ) +} + +function assertIndicatorVisible(isVisible) { + cy.get(`[data-gatsby-loading-indicator="root"]`, { timeout: 10000 }).should( + isVisible ? `be.visible` : `not.be.visible` + ) - const refresh = async payload => { - return await fetch(`/__refresh/gatsby-source-query-on-demand-data/`, { - method: `POST`, - headers: { - "Content-Type": `application/json`, - }, - body: payload ? JSON.stringify({ updateData: payload }) : undefined, + cy.screenshot() +} + +function runTests({ + data, + sleep, + mode, + expectIndicatorEnabled, + expectIndicatorVisible, +}) { + // make sure we are not on a page with query + cy.visit(`/query-on-demand/no-query/`).waitForRouteChange() + + // setup data for page with query + cy.then(() => + refresh({ + data, + sleep, }) - } + ) - function assertIndicatorExists(doesExists) { - cy.get(`[data-gatsby-loading-indicator="root"]`, { timeout: 10000 }).should( - doesExists ? `exist` : `not.exist` + if (mode === `first-render`) { + cy.visit(`/query-on-demand/possibly-heavy-query/`) + } else if (mode === `client-navigation`) { + cy.findByTestId(`heavy-query-page-link`).click() + } else { + throw new Error( + `Unknown mode - should be one of ["first-render", "client-navigation"]` ) } - function assertIndicatorVisible(isVisible) { - cy.get(`[data-gatsby-loading-indicator="root"]`, { timeout: 10000 }).should( - isVisible ? `be.visible` : `not.be.visible` - ) - - cy.screenshot() + // we wait for first render or for client side navigation to complete when we expect for loading indicator + // to show up (depending on test setup) + if (expectIndicatorEnabled) { + assertIndicatorExists(true) + assertIndicatorVisible(expectIndicatorVisible) + } else { + assertIndicatorExists(false) } - function runTests({ - data, - sleep, - mode, - expectIndicatorEnabled, - expectIndicatorVisible, - }) { - // make sure we are not on a page with query - cy.visit(`/query-on-demand/no-query/`).waitForRouteChange() - - // setup data for page with query - cy.then(() => - refresh({ - data, - sleep, - }) - ) + cy.waitForRouteChange() - if (mode === `first-render`) { - cy.visit(`/query-on-demand/possibly-heavy-query/`) - } else if (mode === `client-navigation`) { - cy.findByTestId(`heavy-query-page-link`).click() - } else { - throw new Error( - `Unknown mode - should be one of ["first-render", "client-navigation"]` - ) - } - - // we wait for first render or for client side navigation to complete when we expect for loading indicator - // to show up (depending on test setup) - if (expectIndicatorEnabled) { - assertIndicatorExists(true) - assertIndicatorVisible(expectIndicatorVisible) - } else { - assertIndicatorExists(false) - } - - cy.waitForRouteChange() - - // once we finished first render or client side navigation - loading indicator should not be visible anymore (if it was before) - if (expectIndicatorEnabled) { - assertIndicatorExists(true) - assertIndicatorVisible(false) - } else { - assertIndicatorExists(false) - } - - // making sure our test setup was correct and expect query result is rendered - cy.findByTestId(`query-data`).should(`have.text`, data) + // once we finished first render or client side navigation - loading indicator should not be visible anymore (if it was before) + if (expectIndicatorEnabled) { + assertIndicatorExists(true) + assertIndicatorVisible(false) + } else { + assertIndicatorExists(false) } - describe(`Loading indicator`, () => { - before(async () => { - Cypress.config(`includeShadowDom`, true) - }) + // making sure our test setup was correct and expect query result is rendered + cy.findByTestId(`query-data`).should(`have.text`, data) +} + +describe(`Loading indicator`, () => { + before(async () => { + Cypress.config(`includeShadowDom`, true) + }) + + after(async () => { + toggleLoadingIndicator(`auto`) + }) - after(async () => { + // we disable showing loading indicator in cypress by default + // to not impact user tests - this is to make sure that's the case/catch regressions + describe(`Defaults in cypress env (doesn't show indicator)`, () => { + before(async () => { toggleLoadingIndicator(`auto`) }) - // we disable showing loading indicator in cypress by default - // to not impact user tests - this is to make sure that's the case/catch regressions - describe(`Defaults in cypress env (doesn't show indicator)`, () => { - before(async () => { - toggleLoadingIndicator(`auto`) - }) - - describe(`Page with light/quick query doesn't show indicator`, () => { - const config = { - sleep: 0, - expectIndicatorEnabled: false, - expectIndicatorVisible: `doesn't matter because indicator should not be enabled`, - } - - it(`Initial first render`, () => { - runTests({ - ...config, - data: `quick-first-render-with-disabled-indicator`, - mode: `first-render`, - }) + describe(`Page with light/quick query doesn't show indicator`, () => { + const config = { + sleep: 0, + expectIndicatorEnabled: false, + expectIndicatorVisible: `doesn't matter because indicator should not be enabled`, + } + + it(`Initial first render`, () => { + runTests({ + ...config, + data: `quick-first-render-with-disabled-indicator`, + mode: `first-render`, }) + }) - it(`On navigation`, () => { - runTests({ - ...config, - data: `quick-client-navigation-with-disabled-indicator`, - mode: `client-navigation`, - }) + it(`On navigation`, () => { + runTests({ + ...config, + data: `quick-client-navigation-with-disabled-indicator`, + mode: `client-navigation`, }) }) + }) - describe(`Page with heavy/long running query doesn't show indicator (indicator is disabled)`, () => { - const config = { - sleep: 5000, - expectIndicatorEnabled: false, - expectIndicatorVisible: `doesn't matter because indicator should not be enabled`, - } - - it(`Initial first render`, () => { - runTests({ - ...config, - data: `slow-first-render-with-disabled-indicator`, - mode: `first-render`, - }) + describe(`Page with heavy/long running query doesn't show indicator (indicator is disabled)`, () => { + const config = { + sleep: 5000, + expectIndicatorEnabled: false, + expectIndicatorVisible: `doesn't matter because indicator should not be enabled`, + } + + it(`Initial first render`, () => { + runTests({ + ...config, + data: `slow-first-render-with-disabled-indicator`, + mode: `first-render`, }) + }) - it(`On navigation`, () => { - runTests({ - ...config, - data: `slow-client-navigation-with-disabled-indicator`, - mode: `client-navigation`, - }) + it(`On navigation`, () => { + runTests({ + ...config, + data: `slow-client-navigation-with-disabled-indicator`, + mode: `client-navigation`, }) }) }) + }) - describe(`With enabled loading indicator`, () => { - before(async () => { - toggleLoadingIndicator(`enable`) - }) + describe(`With enabled loading indicator`, () => { + before(async () => { + toggleLoadingIndicator(`enable`) + }) - describe(`Page with light/quick query doesn't show indicator`, () => { - const config = { - sleep: 0, - expectIndicatorEnabled: true, - expectIndicatorVisible: false, - } - - it(`Initial first render`, () => { - runTests({ - ...config, - data: `quick-first-render-with-enabled-indicator`, - mode: `first-render`, - }) + describe(`Page with light/quick query doesn't show indicator`, () => { + const config = { + sleep: 0, + expectIndicatorEnabled: true, + expectIndicatorVisible: false, + } + + it(`Initial first render`, () => { + runTests({ + ...config, + data: `quick-first-render-with-enabled-indicator`, + mode: `first-render`, }) + }) - it(`On navigation`, () => { - runTests({ - ...config, - data: `quick-client-navigation-with-enabled-indicator`, - mode: `client-navigation`, - }) + it(`On navigation`, () => { + runTests({ + ...config, + data: `quick-client-navigation-with-enabled-indicator`, + mode: `client-navigation`, }) }) + }) - describe(`Page with heavy/long running query shows indicator`, () => { - const config = { - sleep: 5000, - expectIndicatorEnabled: true, - expectIndicatorVisible: true, - } - - it(`Initial first render`, () => { - runTests({ - ...config, - data: `slow-first-render-with-enabled-indicator`, - mode: `first-render`, - }) + describe(`Page with heavy/long running query shows indicator`, () => { + const config = { + sleep: 5000, + expectIndicatorEnabled: true, + expectIndicatorVisible: true, + } + + it(`Initial first render`, () => { + runTests({ + ...config, + data: `slow-first-render-with-enabled-indicator`, + mode: `first-render`, }) + }) - it(`On navigation`, () => { - runTests({ - ...config, - data: `slow-client-navigation-with-enabled-indicator`, - mode: `client-navigation`, - }) + it(`On navigation`, () => { + runTests({ + ...config, + data: `slow-client-navigation-with-enabled-indicator`, + mode: `client-navigation`, }) }) }) }) -} else { - it.skip( - `This is not running in query on demand mode, so there is not loading indicator` - ) -} +}) From 7b4e4c20d7c5618e65de548be108c1f205fc9cbf Mon Sep 17 00:00:00 2001 From: Michal Piechowiak Date: Tue, 23 Feb 2021 20:15:46 +0100 Subject: [PATCH 5/5] no more wat --- packages/gatsby/src/utils/loading-indicator.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/gatsby/src/utils/loading-indicator.ts b/packages/gatsby/src/utils/loading-indicator.ts index 9f502cf5826f9..36b00c48dcbd7 100644 --- a/packages/gatsby/src/utils/loading-indicator.ts +++ b/packages/gatsby/src/utils/loading-indicator.ts @@ -20,8 +20,6 @@ export function writeVirtualLoadingIndicatorModule(): void { : false } - console.log(`wat`, { indicatorEnabled }) - writeModule( `$virtual/loading-indicator.js`, `