Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
describe('Heading', () => {
const storyUrl = getStoryUrl('Components', 'Heading');
beforeEach(() => browser.get(storyUrl));
eyes.it('should display correct content', () => {
const dataHook = 'storybook-heading';
const driver = headingTestkitFactory({dataHook});
return waitForVisibilityOf(driver.element(), 'Cannot find Heading')
.then(() => expect(driver.getText()).toBe('Some text'));
});
});
describe('UIText', () => {
const storyUrl = getStoryUrl('Internal', 'UIText');
beforeEach(() => browser.get(storyUrl));
eyes.it('should display correct content', () => {
const dataHook = 'storybook-uiText';
const driver = uiTextTestkitFactory({dataHook});
return waitForVisibilityOf(driver.element(), 'Cannot find UIText')
.then(() => expect(driver.getText()).toBe('Some text'));
});
});
describe('Autocomplete', () => {
const storyUrl = getStoryUrl('Components', 'Autocomplete');
const dataHook = 'storybook-autocomplete';
beforeEach(() => browser.get(storyUrl));
eyes.it('should render autocomplete', async () => {
const driver = autocompleteTestkitFactory({ dataHook });
await waitForVisibilityOf(driver.element(), 'Cannot find Autocomplete');
expect(driver.element()).toBeDefined();
});
});
describe('AddressInput', () => {
const storyUrl = getStoryUrl('Components', 'AddressInput');
let driver;
beforeAll(async () => {
await browser.get(storyUrl);
driver = addressInputTestkitFactory({dataHook: 'storybook-address-input'});
await waitForVisibilityOf(driver.element(), 'Cannot find AddressInput');
});
afterEach(() => autoExampleDriver.reset());
eyes.it('should exist', () => {
expect(driver.element().isPresent()).toBe(true);
});
eyes.it('should display mocked addresses', async () => {
driver.pressKey('n');
describe('CounterBadge', () => {
const storyUrl = getStoryUrl('Components', 'StylableCounterBadge');
beforeEach(() => browser.get(storyUrl));
eyes.it('should display correct content', () => {
const dataHook = 'storybook-counterBadge';
const driver = counterBadgeTestkitFactory({ dataHook });
return waitForVisibilityOf(
driver.element(),
'Cannot find CounterBadge'
).then(() => expect(driver.text()).toBe('12'));
});
eyes.it('should display "99+" when number > 99', () => {
const dataHook = 'storybook-counterBadge';
const driver = counterBadgeTestkitFactory({ dataHook });