Skip to content

example test fails #11

@patrickkmatias

Description

@patrickkmatias

the example test fails even in a clean, empty qwik repository.

cypress is working fine, it can render components and test components. But the two last tests are breaking, with the same error.

example.cy.tsx

import { ExampleTest } from "./example";

it("should render ⭐", () => {
  cy.mount(<ExampleTest flag={true} />);
  cy.get("div.icon").should("contain.text", "⭐");
});

it("should render 💣", () => {
  cy.mount(<ExampleTest flag={false} />);
  cy.get("div.icon").should("contain.text", "💣");
});

it("should count clicks", () => {
  cy.mount(<ExampleTest flag={true} />);
  cy.get("span").should("contain.text", "Count:0");
  cy.get("button").click();
  cy.get("span").should("contain.text", "Count:1");
});

logs:

Error: Code(5): You can render over a existing q:container. Skipping render().
    at createAndLogError (http://localhost:5173/__cypress/src/node_modules/@builder.io/qwik/dist/core.mjs?v=bf218913:160:54)
    at logErrorAndStop (http://localhost:5173/__cypress/src/node_modules/@builder.io/qwik/dist/core.mjs?v=bf218913:109:17)
    at qError (http://localhost:5173/__cypress/src/node_modules/@builder.io/qwik/dist/core.mjs?v=bf218913:316:12)
    at render (http://localhost:5173/__cypress/src/node_modules/@builder.io/qwik/dist/core.mjs?v=bf218913:9203:15)
    at Context.mount (http://localhost:5173/__cypress/src/node_modules/.vite/deps/cypress-ct-qwik.js?v=bf218913:39:31)
From previous event:
    at Promise.longStackTracesCaptureStackTrace [as _captureStackTrace] (http://localhost:5173/__cypress/runner/cypress_runner.js:3486:19)
    at Promise._then (http://localhost:5173/__cypress/runner/cypress_runner.js:1239:17)
    at Promise._passThrough (http://localhost:5173/__cypress/runner/cypress_runner.js:4110:17)
    at Promise.lastly.Promise.finally (http://localhost:5173/__cypress/runner/cypress_runner.js:4119:17)
    at Object.onRunnableRun (http://localhost:5173/__cypress/runner/cypress_runner.js:162210:53)
    at $Cypress.action (http://localhost:5173/__cypress/runner/cypress_runner.js:41015:28)
    at Runnable.run (http://localhost:5173/__cypress/runner/cypress_runner.js:144798:13)
    at Runner.runTest (http://localhost:5173/__cypress/runner/cypress_runner.js:154960:10)
    at <unknown> (http://localhost:5173/__cypress/runner/cypress_runner.js:155086:12)
    at next (http://localhost:5173/__cypress/runner/cypress_runner.js:154869:14)
    at <unknown> (http://localhost:5173/__cypress/runner/cypress_runner.js:154879:7)
    at next (http://localhost:5173/__cypress/runner/cypress_runner.js:154781:14)
    at <unknown> (http://localhost:5173/__cypress/runner/cypress_runner.js:154847:5)
    at timeslice (http://localhost:5173/__cypress/runner/cypress_runner.js:145082:27)

removing cy.mount() from the last two tests stops this error, but make the second test fail as it expect it to be rendered again with the flag set to false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions