-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7eeac9c
commit 9eadc2e
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="stylesheet" href="/tests/reset.css" /> | ||
<link rel="stylesheet" href="/public/flows.css" /> | ||
</head> | ||
<body> | ||
<div | ||
style="background-color: grey; width: 20px; height: 20px; margin: 40px" | ||
class="target" | ||
></div> | ||
|
||
<script type="module" src="./html-content.ts"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { expect, test } from "@playwright/test"; | ||
|
||
test("HTML content in tooltip", async ({ page }) => { | ||
await page.goto("/html-content/html-content.html?tooltip=true"); | ||
await expect(page.locator(".flows-tooltip .span-in-title")).toHaveText("span in title"); | ||
await expect(page.locator(".flows-tooltip .span-in-body")).toHaveText("span in body"); | ||
}); | ||
|
||
test("HTML content in modal", async ({ page }) => { | ||
await page.goto("/html-content/html-content.html"); | ||
await expect(page.locator(".flows-modal .span-in-title")).toHaveText("span in title"); | ||
await expect(page.locator(".flows-modal .span-in-body")).toHaveText("span in body"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { FlowStep, FlowTooltipStep } from "../../dist"; | ||
import { init } from "../../dist"; | ||
|
||
const tooltip = new URLSearchParams(window.location.search).get("tooltip") === "true"; | ||
|
||
const step: FlowStep = { | ||
title: '<span class="span-in-title">span in title</span>', | ||
body: '<span class="span-in-body">span in body</span>', | ||
}; | ||
if (tooltip) (step as FlowTooltipStep).element = ".target"; | ||
|
||
void init({ | ||
flows: [ | ||
{ | ||
id: "flow", | ||
location: "/", | ||
steps: [step], | ||
}, | ||
], | ||
}); |