How to use @storybook/addon-storyshots - 10 common examples

To help you get started, we’ve selected a few @storybook/addon-storyshots examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pluralsight / design-system / packages / avatar / src / react / __specs__ / storyshots.spec.js View on Github external
import initStoryshots, {
  snapshotWithOptions
} from '@storybook/addon-storyshots'

jest.mock('@pluralsight/ps-design-system-storybook-addon-center')

const createNodeMock = el => document.createElement('div')

initStoryshots({
  //   configPath: path.resolve(__dirname, '..', '..', '..', '.storybook')
  framework: 'react',
  test: snapshotWithOptions({ createNodeMock })
})
github pluralsight / design-system / packages / icon / src / react / __specs__ / storyshots.spec.js View on Github external
import initStoryshots, {
  snapshotWithOptions
} from '@storybook/addon-storyshots'

jest.mock('@pluralsight/ps-design-system-storybook-addon-center')
jest.mock('@pluralsight/ps-design-system-storybook-addon-theme')
// jest.mock('@pluralsight/ps-design-system-storybook-addon-theme', () => fn => {
//   return fn()
// })

const createNodeMock = el => document.createElement('div')

initStoryshots({
  framework: 'react',
  test: snapshotWithOptions({ createNodeMock })
})
github pluralsight / design-system / packages / dialog / src / react / __specs__ / storyshots.spec.js View on Github external
import initStoryshots, {
  snapshotWithOptions
} from '@storybook/addon-storyshots'

jest.mock('@pluralsight/ps-design-system-storybook-addon-center')

const createNodeMock = el => document.createElement('div')

initStoryshots({
  framework: 'react',
  test: snapshotWithOptions({ createNodeMock })
})
github pluralsight / design-system / packages / text / src / react / __specs__ / storyshots.spec.js View on Github external
import initStoryshots, {
  snapshotWithOptions
} from '@storybook/addon-storyshots'

const createNodeMock = el => document.createElement('div')

initStoryshots({
  framework: 'react',
  test: snapshotWithOptions({ createNodeMock })
})
github pluralsight / design-system / packages / carousel / src / react / __specs__ / storyshots.spec.js View on Github external
jest.mock('@pluralsight/ps-design-system-storybook-addon-center')
jest.mock('@pluralsight/ps-design-system-storybook-addon-theme')

jest.mock('../../js/utils.js', () => ({
  ...jest.requireActual('../../js/utils.js'),
  uniqueId: jest
    .fn()
    .mockImplementation((prefix = '') => prefix + 'mock_unique_id')
}))

const createNodeMock = el => document.createElement('div')

initStoryshots({
  configPath: path.resolve(__dirname, '../../../.storybook'),
  framework: 'react',
  test: snapshotWithOptions({ createNodeMock })
})
github pluralsight / design-system / packages / emptystate / src / react / __specs__ / storyshots.spec.js View on Github external
import path from 'path'
import initStoryshots, {
  snapshotWithOptions
} from '@storybook/addon-storyshots'

jest.mock('@pluralsight/ps-design-system-storybook-addon-center')
jest.mock('@pluralsight/ps-design-system-storybook-addon-theme')

const createNodeMock = el => document.createElement('div')

initStoryshots({
  configPath: path.resolve(__dirname, '..', '..', '..', '.storybook'),
  test: snapshotWithOptions({ createNodeMock })
})
github pluralsight / design-system / packages / checkbox / src / react / __specs__ / storyshots.spec.js View on Github external
import initStoryshots, {
  snapshotWithOptions
} from '@storybook/addon-storyshots'

jest.mock('@pluralsight/ps-design-system-storybook-addon-center')

const createNodeMock = el => document.createElement('div')

initStoryshots({
  framework: 'react',
  test: snapshotWithOptions({ createNodeMock })
})
github pluralsight / design-system / packages / circularprogress / src / react / __specs__ / storyshots.spec.js View on Github external
import path from 'path'
import initStoryshots, {
  snapshotWithOptions
} from '@storybook/addon-storyshots'

jest.mock('@pluralsight/ps-design-system-storybook-addon-center')
jest.mock('@pluralsight/ps-design-system-storybook-addon-theme')

const createNodeMock = el => document.createElement('div')

initStoryshots({
  configPath: path.resolve(__dirname, '..', '..', '..', '.storybook'),
  test: snapshotWithOptions({ createNodeMock })
})
github pluralsight / design-system / packages / layout / src / react / __specs__ / storyshots.spec.js View on Github external
import initStoryshots, {
  snapshotWithOptions
} from '@storybook/addon-storyshots'

jest.mock('@pluralsight/ps-design-system-storybook-addon-theme')

const createNodeMock = el => document.createElement('div')

initStoryshots({
  framework: 'react',
  test: snapshotWithOptions({ createNodeMock })
})

@storybook/addon-storyshots

Take a code snapshot of every story automatically with Jest

MIT
Latest version published 9 months ago

Package Health Score

64 / 100
Full package analysis