analytics/tracker/test/pageview.spec.js
Uku Taht 43bf7dd09f
Use user-agent instead of screen_width to get device type (#2711)
* Use user-agent instead of screen_width to get device type

Co-authored-by: eriknakata <erik.nakata5@gmail.com>

* Fix credo

* Log on unhandled UAInspector device type

* Make 'browser' the default tab in devices report

* Remove device tooltip

* Remove screen_width from ingestion completely

* Remove browserstack harness, run playwright directly

* Select meta key based on OS platform

* Run CI tests in parallel

* Improve device match readability

* Add changelog

---------

Co-authored-by: eriknakata <erik.nakata5@gmail.com>
2023-03-02 11:04:01 +01:00

14 lines
511 B
JavaScript

const { mockRequest } = require('./support/test-utils')
const { expect, test } = require('@playwright/test');
test.describe('Basic installation', () => {
test('Sends pageview automatically', async ({ page }) => {
const plausibleRequestMock = mockRequest(page, '/api/event')
await page.goto('/simple.html');
const plausibleRequest = await plausibleRequestMock;
expect(plausibleRequest.url()).toContain('/api/event')
expect(plausibleRequest.postDataJSON().n).toEqual('pageview')
});
});