Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
tyhopp committed May 17, 2022
1 parent 25dcdca commit f5d616a
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Script, scripts } from "../../../gatsby-script-scripts"
import { ResourceRecord } from "../../records"
import { script } from "../../../gatsby-script-scripts"
import { resourceRecord } from "../../../gatsby-script-records"

// The page that we will assert against
const page = `/gatsby-script-scripts-with-sources`
Expand All @@ -16,17 +16,17 @@ Cypress.on(`window:before:load`, win => {
describe(`using the idle strategy with shimmed requestIdleCallback`, () => {
it(`should load successfully`, () => {
cy.visit(page).waitForRouteChange()
cy.getRecord(Script.marked, `success`, true).should(`equal`, `true`)
cy.getRecord(script.marked, `success`, true).should(`equal`, `true`)

cy.get("@requestIdleCallback").should("not.be.called")
})

it(`should load after other strategies`, () => {
cy.visit(page).waitForRouteChange()

cy.getRecord(Script.marked, ResourceRecord.fetchStart).then(
cy.getRecord(script.marked, resourceRecord.fetchStart).then(
markedFetchStart => {
cy.getRecord(Script.three, ResourceRecord.fetchStart).should(
cy.getRecord(script.three, resourceRecord.fetchStart).should(
`be.lessThan`,
markedFetchStart
)
Expand All @@ -37,7 +37,7 @@ describe(`using the idle strategy with shimmed requestIdleCallback`, () => {

it(`should call an on load callback once the script has loaded`, () => {
cy.visit(page).waitForRouteChange()
cy.getRecord(Script.marked, ResourceRecord.responseEnd).then(() => {
cy.getRecord(script.marked, resourceRecord.responseEnd).then(() => {
cy.get(`[data-on-load-result=idle]`)
})
cy.get("@requestIdleCallback").should("not.be.called")
Expand Down

0 comments on commit f5d616a

Please sign in to comment.