Skip to content

Commit

Permalink
Example of general vdiff result experience
Browse files Browse the repository at this point in the history
  • Loading branch information
svanherk committed Aug 11, 2023
1 parent 23dcd65 commit 05841fc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/browser/element.vdiff.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { css, html, LitElement } from 'lit';
import { defineCE, expect, fixture, hoverElem } from '../../src/browser/index.js';
//import { executeServerCommand } from '@web/test-runner-commands';
import { executeServerCommand } from '@web/test-runner-commands';

const elementTag = defineCE(
class extends LitElement {
Expand Down Expand Up @@ -87,13 +87,14 @@ describe('element-different', () => {
].forEach(({ name, action }) => {
it(name, async() => {
const elem = await fixture(`<${elementTag} text="Visual Difference"></${elementTag}>`);
const isGolden = true; //await executeServerCommand('vdiff-get-golden-flag');
const isGolden = await executeServerCommand('vdiff-get-golden-flag');
if (!isGolden) {
await action(elem);
await elem.updateComplete;
}

let fail = false;
await expect(elem).to.be.golden();
/*let fail = false;
try {
await expect(elem).to.be.golden();
} catch (ex) {
Expand All @@ -102,7 +103,7 @@ describe('element-different', () => {
if (!isGolden) {
expect(fail, 'current and golden images to be different').equal(true);
}
}*/
});
});
});

0 comments on commit 05841fc

Please sign in to comment.