-
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
9eadc2e
commit 78dee9b
Showing
4 changed files
with
41 additions
and
1 deletion.
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
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,12 @@ | ||
<!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> | ||
<script type="module" src="./targeting.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,11 @@ | ||
import { expect, test } from "@playwright/test"; | ||
|
||
test("Shouldn't show up when used doesn't match", async ({ page }) => { | ||
await page.goto("/targeting/targeting.html"); | ||
await expect(page.locator(".flows-modal")).not.toBeVisible(); | ||
}); | ||
|
||
test("Should show up when used matches", async ({ page }) => { | ||
await page.goto("/targeting/targeting.html?john=true"); | ||
await expect(page.locator(".flows-modal")).toBeVisible(); | ||
}); |
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 @@ | ||
import { init } from "../../dist"; | ||
|
||
const john = new URLSearchParams(window.location.search).get("john") === "true"; | ||
|
||
void init({ | ||
flows: [ | ||
{ | ||
id: "flow", | ||
location: "/", | ||
userProperties: [{ key: "name", eq: "John Doe" }], | ||
steps: [{ title: "Hello" }], | ||
}, | ||
], | ||
userProperties: { | ||
name: john ? "John Doe" : undefined, | ||
}, | ||
}); |