Skip to content

Commit

Permalink
scene view renders all challenges - test
Browse files Browse the repository at this point in the history
  • Loading branch information
dlopezalvas committed Sep 26, 2024
1 parent c54b0c7 commit 3d50a97
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/test/integration/ChallengeView.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { SerializedChallenge } from '../../components/serializedChallenge'
import { EMBER_IMPORTED_CHALLENGE_PATH } from '../../components/ImportedChallengeView'
import { ThemeContextProvider } from '../../theme/ThemeContext'

describe('<ChallengeView />', () => {
describe('Integration - Challenge view (scene view and blockly)', () => {
const challenge: SerializedChallenge = {
fileVersion: 0,
title: '',
Expand Down
18 changes: 18 additions & 0 deletions src/test/unit/components/ChallengeView/SceneView.cy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { mount } from 'cypress/react18'
import React from 'react'
import { SceneView } from '../../../../components/challengeView/SceneView'
import { allDescriptors } from '../../../../staticData/challenges'
import { scene } from '../../../../components/challengeView/scene'
import { screen } from '@testing-library/react'


describe('SceneView renders all challenges', () => {

allDescriptors().forEach((descriptor) => {
it(`Scene ${scene.sceneName(descriptor)} renders ok`, () => {
mount(<SceneView descriptor={descriptor}
onLoad={() => expect((screen.getByTestId("scene-iframe") as any).contentWindow.eval("pilas.escena_actual().automata")).to.exist} />)
})
})
})

42 changes: 0 additions & 42 deletions src/test/unit/components/ChallengeView/SceneView.test.tsx

This file was deleted.

0 comments on commit 3d50a97

Please sign in to comment.