-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tracker): add trailing slash to data-api option (#147)
* fix(tracker): add trailing slash to data api * test: add e2e testing for data-api option
- Loading branch information
Showing
16 changed files
with
63 additions
and
17 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,21 @@ | ||
// @ts-check | ||
|
||
import { test, expect } from '@playwright/test'; | ||
|
||
test.describe('data-api', () => { | ||
test('data-api connects to alternative api', async ({ page }) => { | ||
const requests = []; | ||
await page.on('request', (request) => { | ||
console.log('>>', request.method(), request.url()); | ||
if (request.url().includes('/api/event')) requests.push(request.url()); | ||
}); | ||
|
||
await page.goto('/data-api/index.html', { waitUntil: 'load' }); | ||
await page.waitForLoadState(); | ||
|
||
expect(requests.length).toBeGreaterThan(0); | ||
for (const url of requests) { | ||
expect(url).toContain('example.com'); | ||
} | ||
}); | ||
}); |
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,26 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Normal Webpage</title> | ||
</head> | ||
|
||
<body data-m:load="load=test;load2=test2"> | ||
<h1 data-m:load="load3=test2">Normal Webpage</h1> | ||
<nav> | ||
<a href="index.html">Home</a> | ||
<a href="about.html">About</a> | ||
<a href="contact.html">Contact</a> | ||
</nav> | ||
<div id="content"> | ||
<p>This is the home page.</p> | ||
<button data-testid="tagged-left-click" data-m:click="button=left;action=button">Tagged Event Left Click</button> | ||
<button data-testid="tagged-middle-click" data-m:click="button=middle;action=button">Tagged Event Middle | ||
Click</button> | ||
<button data-testid="tagged-right-click" data-m:click="button=right;action=button">Tagged Event Right Click</button> | ||
</div> | ||
<script defer src="http://localhost:3000/script.js" data-api="example.com/api"></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