Skip to content

Commit

Permalink
cypress: remove knobs as it removed in Storybook 7
Browse files Browse the repository at this point in the history
  • Loading branch information
giannif committed Jul 25, 2023
1 parent 2ec9b23 commit bf9155b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
4 changes: 0 additions & 4 deletions packages/react-components/cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { mount } from '@cypress/react18'

import { resetKnobs } from '../utils/storybook'

function stopVideo(elements: JQuery<HTMLVideoElement> | void) {
const source = elements ? cy.wrap(elements) : cy.get('video')
source
Expand Down Expand Up @@ -36,12 +34,10 @@ declare global {
namespace Cypress {
interface Chainable {
mount: typeof mount
resetKnobs: typeof resetKnobs
stopVideo: () => void
}
}
}

Cypress.Commands.add('mount', mount)
Cypress.Commands.add('resetKnobs', resetKnobs)
Cypress.Commands.add('stopVideo', { prevSubject: ['optional'] }, stopVideo)
6 changes: 0 additions & 6 deletions packages/react-components/cypress/support/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,3 @@ import '@percy/cypress'

// Import commands.js using ES2015 syntax:
import './commands'

// The Storybook Knobs addon has an issue with resetting values when you go to a new story.
// To solve this problem, we have to clear the Knobs state manually every time before running story tests
afterEach(() => {
cy.resetKnobs()
})
21 changes: 0 additions & 21 deletions packages/react-components/cypress/utils/storybook.ts

This file was deleted.

0 comments on commit bf9155b

Please sign in to comment.