fix test issues

This commit is contained in:
Emily Rohrbough
2022-01-21 16:30:33 -06:00
parent 82aea71624
commit 7cbf92ca4e
4 changed files with 11 additions and 11 deletions

View File

@@ -1,3 +1,5 @@
import type { AuthMessage } from '../../../data-context/src/actions/AuthActions'
describe('App Top Nav Workflows', () => {
beforeEach(() => {
cy.scaffoldProject('launchpad')
@@ -105,8 +107,7 @@ describe('App Top Nav Workflows', () => {
it('renders link to external docs if version is current', () => {
cy.findBrowsers()
cy.withCtx(async (ctx) => {
// @ts-ignore sinon is a global in the node process where this is executed
sinon.stub(ctx, 'versions').resolves({
Cypress.sinon.stub(ctx, 'versions').resolves({
current: {
id: '1',
version: '10.0.0',
@@ -138,8 +139,7 @@ describe('App Top Nav Workflows', () => {
const currRelease = new Date(Date.UTC(2021, 9, 30))
const prevRelease = new Date(Date.UTC(2021, 9, 29))
// @ts-ignore sinon is a global in the node process where this is executed
sinon.stub(ctx, 'versions').resolves({
Cypress.sinon.stub(ctx, 'versions').resolves({
current: {
id: '1',
version: '10.0.0',
@@ -307,7 +307,7 @@ describe('App Top Nav Workflows', () => {
cy.get('@logInButton').click()
cy.withCtx((ctx) => {
sinon.stub(ctx._apis.authApi, 'logOut').callsFake(async () => {
Cypress.sinon.stub(ctx._apis.authApi, 'logOut').callsFake(async () => {
// resolves
})
})
@@ -336,8 +336,8 @@ describe('App Top Nav Workflows', () => {
const mockLogInActionsForUser = (user) => {
cy.withCtx((ctx, options) => {
sinon.stub(ctx._apis.authApi, 'logIn').callsFake(async (onMessage) => {
onMessage({ browserOpened: true })
Cypress.sinon.stub(ctx._apis.authApi, 'logIn').callsFake(async (onMessage) => {
onMessage({ browserOpened: true } as AuthMessage)
return new Promise((resolve) => {
setTimeout(() => {

View File

@@ -1,7 +1,8 @@
import type { DataContext } from '..'
import type { AuthenticatedUserShape } from '../data'
interface AuthMessage {type: string, browserOpened: boolean, name: string, message: string}
export interface AuthMessage {type: string, browserOpened: boolean, name: string, message: string}
export interface AuthApiShape {
getUser(): Promise<Partial<AuthenticatedUserShape>>
logIn(onMessage: (message: AuthMessage) => void): Promise<AuthenticatedUserShape>

View File

@@ -3,8 +3,8 @@ describe('selector_playground', () => {
cy.visit('/fixtures/dom.html')
.then(() => {
// We trick the selector-playground into rendering while the test is running
top.Runner.configureMobx({ enforceActions: 'never' })
top.Runner.state.isRunning = false
top.UnifiedRunner.MobX.configure({ enforceActions: 'never' })
top.__showSelectorPlaygroundForTestingPurposes()
const $highlightBtn = cy.$$('button.highlight-toggle:visible', top.document)

View File

@@ -232,7 +232,6 @@ exports['e2e web security / firefox / displays warning when firefox and chromeWe
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: simple_passing.cy.js (1 of 1)
Your project has set the configuration option: \`chromeWebSecurity: false\`
This option will not have an effect in Firefox. Tests that rely on web security being disabled will not run as expected.