Skip to content

Commit

Permalink
test(KTL-1189); add highlight only tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zoobestik committed Aug 24, 2023
1 parent 6ef3a88 commit 113f7b5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions tests/basics.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,24 @@ test.describe('basics', () => {
await prepareNetwork(page, baseURL); // offline mode
});

test('highlight only', async ({ page }) => {
await gotoHtmlWidget(
page,
{ selector: 'code' },
`<code data-highlight-only>${printlnCode('Hello, world!')}</code>`,
);

const editor = page.locator(WIDGET_SELECTOR);

await expect(editor).toHaveCount(1); // playground loaded
await expect(editor.locator(OPEN_EDITOR_SELECTOR)).not.toBeVisible(); // open on play-link
await expect(editor.locator(TARGET_SELECTOR)).not.toBeVisible(); // default target JVN
await expect(editor.locator(VERSION_SELECTOR)).not.toBeVisible(); // latest version marker
await expect(editor.locator(RUN_SELECTOR)).not.toBeVisible();

await expectScreenshot(page, 'highlight view');
});

test('simple usage', async ({ page }) => {
await gotoHtmlWidget(
page,
Expand Down

0 comments on commit 113f7b5

Please sign in to comment.