Skip to content

Commit

Permalink
chore: update screenshot test
Browse files Browse the repository at this point in the history
  • Loading branch information
JackUait committed Jul 15, 2022
1 parent f310db7 commit 772e647
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 34 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

38 changes: 21 additions & 17 deletions packages/react-ui/components/Hint/__stories__/Hint.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React from 'react';

import { Meta, Story } from '../../../typings/stories';
import { Hint } from '../Hint';
Expand Down Expand Up @@ -169,39 +169,43 @@ SetManualAndOpenedPropOnClick.parameters = {
};

export const WithSVGIcon: Story = () => {
const [isOpen, setIsOpen] = useState(false);

return (
<>
{/* Manual opening used here as a safer way of performing logic. Opening hint manually does not alter the results of behavior that being tested */}
<Hint opened={isOpen} manual text="hint">
<svg width="16" height="16" viewBox="0 0 16 16">
<path d="M9 3H7V7H3V9H7V13H9V9H13V7H9V3Z" />
</svg>
</Hint>
<button data-tid="button" onClick={() => setIsOpen(true)}>
open manually
</button>
</>
<Hint text="hint">
<svg data-tid="icon" width="16" height="16" viewBox="0 0 16 16">
<path d="M9 3H7V7H3V9H7V13H9V9H13V7H9V3Z" />
</svg>
</Hint>
);
};

WithSVGIcon.parameters = {
creevey: {
skip: [
{
in: ['chromeDark', 'chrome8px', 'firefox8px', 'firefoxFlat8px', 'firefoxDark', 'ie118px', 'ie11Dark'],
in: [
'chromeDark',
'chrome8px',
'firefox8px',
'firefox',
'firefoxFlat8px',
'firefoxDark',
'ie118px',
'ie11',
'ie11Dark',
],
reason: 'internal logic being tested and not something UI related',
},
],
tests: {
async idle() {
await this.expect(await this.takeScreenshot()).to.matchImage('idle');
},
async open() {
async hover() {
await this.browser
.actions()
.click(this.browser.findElement({ css: '[data-tid="button"]' }))
.move({
origin: this.browser.findElement({ css: '[data-tid="icon"]' }),
})
.perform();
await delay(1000);

Expand Down

0 comments on commit 772e647

Please sign in to comment.