Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
describe('Text', () => {
const storyUrl = createStoryUrl({
kind: 'Components',
story: 'Text',
withExamples: true,
});
const dataHook = 'storybook-Text';
beforeEach(() => browser.get(storyUrl));
eyes.it('should render', async () => {
const driver = textTestkitFactory({ dataHook });
await waitForVisibilityOf(driver.element(), 'Cannot find Text');
expect(await driver.element().isDisplayed()).toBe(true);
});
});
describe('Button', () => {
const storyUrl = createStoryUrl({
kind: 'Components',
story: 'Button',
withExamples: true,
});
const dataHook = 'storybook-Button';
beforeEach(() => browser.get(storyUrl));
eyes.it('should render', async () => {
const driver = buttonTestkitFactory({ dataHook });
await waitForVisibilityOf(await driver.element(), 'Cannot find Button');
expect((await driver.element()).isDisplayed()).toBe(true);
});
});
describe('stripCard', () => {
const storyUrl = createStoryUrl({
kind: 'Bookings',
story: 'StripCard',
withExamples: true,
});
const dataHook = 'storybook-StripCard';
beforeEach(() => browser.get(storyUrl));
eyes.it('should render', async () => {
const driver = stripCardTestkitFactory({ dataHook });
await waitForVisibilityOf(await driver.element(), 'Cannot find StripCard');
expect((await driver.element()).isDisplayed()).toBe(true);
});
});
describe('Input', () => {
const storyUrl = createStoryUrl({
kind: 'Components',
story: 'Input',
withExamples: true,
});
const dataHook = 'storybook-Input';
beforeEach(() => browser.get(storyUrl));
eyes.it('should render', async () => {
const driver = inputTestkitFactory({ dataHook });
await waitForVisibilityOf(driver.element(), 'Cannot find Input');
expect(await driver.element().isDisplayed()).toBe(true);
});
});
describe('Input', () => {
const storyUrl = getStoryUrl('Components', 'Input');
const dataHook = 'storybook-input';
beforeEach(() => browser.get(storyUrl));
eyes.it('should render', () => {
const driver = inputTestkitFactory({dataHook});
expect(driver.element().isDisplayed()).toBe(true);
}, {version: 'story with value'});
});