storybookjs / eslint-plugin-storybook

🎗Official ESLint plugin for Storybook
MIT License
248 stars 56 forks source link

Limit play function rules to play functions #28

Open shilman opened 3 years ago

shilman commented 3 years ago

Example from official-storybook https://github.com/storybookjs/storybook/blob/main/examples/official-storybook/stories/addon-storyshots.stories.js

Block.parameters = {
  async puppeteerTest(page) {
    const element = await page.$('[data-test-block]');
    await element.hover();
    const textContent = await element.getProperty('textContent');
    const text = await textContent.jsonValue();
    // eslint-disable-next-line jest/no-standalone-expect
    expect(text).toBe('I am hovered');
  },
};