Skip to content

Commit 947b056

Browse files
committed
e2e tests
1 parent cdd381e commit 947b056

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+5323
-158
lines changed

.github/workflows/playwright.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "Playwright Tests"
2+
on: [pull_request]
3+
jobs:
4+
e2e-tests:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/setup-node@v3
9+
- uses: pnpm/action-setup@v2
10+
with:
11+
version: 10
12+
- name: Install dependencies
13+
run: pnpm install --frozen-lockfile --recursive
14+
15+
- name: Cache Playwright browser binaries
16+
id: playwright-cache
17+
uses: actions/cache@v4
18+
with:
19+
path: ~/.cache/ms-playwright # Default Linux path
20+
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
21+
restore-keys: |
22+
${{ runner.os }}-playwright-
23+
24+
- name: Install Playwright browsers and dependencies (on cache miss)
25+
if: steps.playwright-cache.outputs.cache-hit != 'true'
26+
run: pnpm e2e:install
27+
28+
- name: Build library
29+
run: pnpm prerelease
30+
- name: Run Playwright tests
31+
run: pnpm dev:integrations & pnpm e2e:test
32+
- uses: actions/upload-artifact@v4
33+
if: ${{ !cancelled() }}
34+
with:
35+
name: playwright-report
36+
path: integrations/tests/test-results/
37+
retention-days: 14

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ node_modules
1212
/docs
1313
*.local
1414

15+
integrations/tests/test-results
16+
1517
# Editor directories and files
1618
.vscode/*
1719
!.vscode/extensions.json

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
/generated
44
/public
55

6-
README.md
6+
integrations/next/.next

eslint.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ import tseslint from "typescript-eslint";
66
import { globalIgnores } from "eslint/config";
77

88
export default tseslint.config([
9-
globalIgnores(["dist", "docs", "public/generated"]),
9+
globalIgnores([
10+
"dist",
11+
"docs",
12+
"public/generated",
13+
"integrations/next/.next"
14+
]),
1015
{
1116
files: ["**/*.{ts,tsx}"],
1217
extends: [

integrations/next/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.next

integrations/next/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
# or
12+
pnpm dev
13+
# or
14+
bun dev
15+
```
16+
17+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18+
19+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20+
21+
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
22+
23+
## Learn More
24+
25+
To learn more about Next.js, take a look at the following resources:
26+
27+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29+
30+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
31+
32+
## Deploy on Vercel
33+
34+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35+
36+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"use client";
2+
3+
import { type RowComponentProps } from "react-window";
4+
5+
export function RowComponent({ index, style }: RowComponentProps<object>) {
6+
return (
7+
<div className="flex items-center" style={style}>
8+
Row {index}
9+
</div>
10+
);
11+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"use client";
2+
3+
import { useState } from "react";
4+
import { Decoder as DecoderExternal } from "../../../../tests";
5+
6+
export function Decoder({
7+
encoded: encodedProp,
8+
searchParams: searchParamsMap
9+
}: {
10+
encoded: string;
11+
searchParams: { [key: string]: string | undefined } | undefined;
12+
}) {
13+
const [encoded] = useState(() => decodeURIComponent(encodedProp));
14+
15+
const [searchParams] = useState(() => {
16+
const params = new URLSearchParams();
17+
for (const key in searchParamsMap) {
18+
params.set(key, searchParamsMap[key] ?? "");
19+
}
20+
21+
return params;
22+
});
23+
24+
return <DecoderExternal encoded={encoded} searchParams={searchParams} />;
25+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Decoder } from "./Decoder";
2+
3+
export default async function Page({
4+
params,
5+
searchParams: searchParamsPromise
6+
}: {
7+
params: Promise<{ encoded: string }>;
8+
searchParams?: { [key: string]: string | undefined };
9+
}) {
10+
const { encoded } = await params;
11+
12+
const searchParams = await searchParamsPromise;
13+
14+
return <Decoder encoded={encoded} searchParams={searchParams} />;
15+
}

integrations/next/app/favicon.ico

25.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)