blob: 02ae17dc1f60672ec683f6c27c02b60bf1a2ce7d [file] [log] [blame]
import { expect } from 'chai';
import {loadCachedTestBed, takeScreenshot, TestBed} from '../../../puppeteer-tests/util';
import path from "path";
describe('edit-ignore-rule-sk', () => {
let testBed: TestBed;
before(async () => {
testBed = await loadCachedTestBed(
path.join(__dirname, '..', '..', 'webpack.config.ts')
);
});
beforeEach(async () => {
await testBed.page.goto(`${testBed.baseUrl}/dist/edit-ignore-rule-sk.html`);
});
it('should render the demo page', async () => {
// Smoke test.
expect(await testBed.page.$$('edit-ignore-rule-sk')).to.have.length(4);
});
describe('screenshots', () => {
it('is a view with nothing selected', async () => {
const editor = await testBed.page.$('#empty');
await takeScreenshot(editor!, 'gold', 'edit-ignore-rule-sk');
});
it('has all inputs filled out', async () => {
const editor = await testBed.page.$('#filled');
await takeScreenshot(editor!, 'gold', 'edit-ignore-rule-sk_with-data');
});
it('shows an error when missing data', async () => {
const editor = await testBed.page.$('#missing');
await takeScreenshot(editor!, 'gold', 'edit-ignore-rule-sk_missing-data');
});
it('shows an error when one or more of custom key/value is not filled out', async () => {
const editor = await testBed.page.$('#partial_custom_values');
await takeScreenshot(editor!, 'gold', 'edit-ignore-rule-sk_missing-custom-value');
});
});
});