Skip to content

Releases: happo/happo-plugin-storybook

v2.9.0

01 Jun 20:33
Compare
Choose a tag to compare

This minor release adds support for an afterScreenshot hook. Similar to beforeScreenshot, this hook can be used to clean up things after taking a screenshot of a component.

const Foo = () => <Foo />;
Foo.parameters = {
  happo: {
     afterScreenshot: () => {
        document.querySelector('. bar').remove();
      },
  },
};
export { Foo };

v2.8.0

21 May 21:35
Compare
Choose a tag to compare

This version adds a new option to stories: beforeScreenshot. Use this as a hook to perform certain operations in the DOM before Happo takes the screenshot. Here's an example where a button is clicked in a beforeScreenshot hook:

const BasicModal = () => <ModalExample />;
BasicModal.parameters = {
  happo: {
     beforeScreenshot: () => {
        const clickEvent = new MouseEvent('click', {
          view: window,
          bubbles: true,
          cancelable: false,
        });
        document.querySelector('button.open-modal').dispatchEvent(clickEvent);
      },
  },
};
export { BasicModal };

v2.7.0

05 Nov 10:10
Compare
Choose a tag to compare

This minor release adds support for a new waitFor option that can be used to make certain Storybook stories wait for a condition to be truthy before taking the screenshot. Here's a usage example:

 storiesOf('Some lazy-loading component', module)
    .add('waiting for a selector', () => <LazyLoadingExample />, {
      happo: { waitFor: () => document.querySelector('.lazy-content-ready') },
    });

v2.6.0

20 Oct 18:18
Compare
Choose a tag to compare

This minor release adds support for a new usePrebuiltPackage option to happoPluginStorybook:

// .happo.js
const happoPluginStorybook = require('happo-plugin-storybook');

module.exports = {
  ...
  plugins: [
    happoPluginStorybook({ usePrebuiltPackage: true }),
  ],
  ...
};

This new option allows you to use a pre-built package, which can help speed up certain CI setups.

v2.5.3

30 Jan 11:32
Compare
Choose a tag to compare

This release has a fix for running in Windows environments.

v2.5.2

30 Jan 10:21
Compare
Choose a tag to compare

This version contains a fix for running on Windows. The path used when invoking the build-storybook was containing forward slashes and the fix was to pass it through path.join to normalize for the right platform.

v2.5.1

22 Jan 00:21
Compare
Choose a tag to compare

This release has a few fixes to make things work better with Storybook v5.3 and later.

v2.5.0

25 Nov 11:06
Compare
Choose a tag to compare

This release adds support for a waitForContent parameter. Use it in cases where you have asynchronously loaded content that Happo isn't automatically detecting. E.g.

storiesOf('PaymentForm', module)
  .add('default', () => <PaymentForm />, { happo: { waitForContent: 'Credit card' } });

v2.4.0

15 May 12:13
Compare
Choose a tag to compare

Adds support for a { happo: false } story parameter you can set to avoid doing happo tests on it. (thanks to @jack-sf!)

v2.3.2

23 Mar 23:01
Compare
Choose a tag to compare

Fixes an issue in Safari where a story with a short delay before rendering any content would be considered done prematurely. We work around this by deferring things until the next execution tick, allowing the old story to be unmounted and the new one take its place.