Skip to content

Commit 119a684

Browse files
authored
Merge pull request #490 from webstackdev/feature/implement-e2e-tests-with-mock-third-party-services
Feature/implement e2e tests with mock third party services
2 parents 24d0e93 + a4f5c14 commit 119a684

61 files changed

Lines changed: 3046 additions & 2584 deletions

Some content is hidden

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

‎.github/dependabot.yml‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@ updates:
55
versioning-strategy: "increase"
66
schedule:
77
interval: "weekly"
8-
open-pull-requests-limit: 20
8+
open-pull-requests-limit: 4
99
labels:
1010
- "type: dependencies 🔗"
1111
- "automerge 🤞"
12-
# Ignore list: pin packages that should not be updated automatically
13-
ignore:
14-
- dependency-name: "zod"
15-
update-types: ["version-update:semver-patch", "version-update:semver-minor", "version-update:semver-major"]
1612
- package-ecosystem: "github-actions"
1713
directory: "/"
1814
schedule:

‎.github/workflows/build-and-test.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020

2121
# Define environment variables once at the job level
2222
# These will be available to ALL steps in this job
23-
# @TODO: Same issue with type-check.yml. These are real keys set on GitHub. But the production build only occurs on Vercel, and it's the only place that needs real keys. Once we set up a test framework using Docker containers for Suprabase, Upstash, etc., we should replace these keys with test keys.
2423
env:
2524
CONVERTKIT_API_KEY: ${{ secrets.CONVERTKIT_API_KEY }}
2625
CONVERTKIT_FORM_ID: ${{ secrets.CONVERTKIT_FORM_ID }}
@@ -94,6 +93,9 @@ jobs:
9493
- name: Start Supabase stack
9594
run: npm run containers:supabase:start
9695

96+
- name: Apply Supabase migrations
97+
run: npm run containers:supabase:db-push
98+
9799
- name: Run Playwright E2E tests
98100
run: npx playwright test
99101
env:

‎.vscode/settings.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"Joomla",
4545
"jscoverage",
4646
"Karamov",
47+
"keyup",
4748
"KHTML",
4849
"koko",
4950
"labelledby",
@@ -69,9 +70,11 @@
6970
"oklch",
7071
"Onest",
7172
"optin",
73+
"PGRST",
7274
"pids",
7375
"pleroma",
7476
"Poslovski",
77+
"Postg",
7578
"Qualys",
7679
"registrator",
7780
"repost",

‎@types/window.d.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ declare global {
5252
*/
5353
isPlaywrightControlled?: boolean
5454

55+
/**
56+
* Allows Playwright tests to disable PWA service worker registration
57+
*/
58+
__disableServiceWorkerForE2E?: boolean
59+
5560
/**
5661
* Snapshot of environment-client results for Playwright assertions
5762
*/

‎README.md‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,40 @@ git push -u origin feature/your-feature-name
3636
- Branch name must follow conventions
3737
- Cannot commit directly to main
3838

39+
### Local Development Server
40+
41+
Use the helper script below to start Astro with `.env.development` automatically loaded:
42+
43+
```bash
44+
npm run dev:env
45+
```
46+
47+
The underlying `npm run dev` command remains unchanged for CI and Vercel; `dev:env` is just a convenience for local shells so API routes that depend on `process.env` (cron handlers, email providers, etc.) behave the same way they do in production.
48+
49+
## Supabase Production Initialization
50+
51+
Provisioning the hosted Supabase project uses the same SQL migrations that back local development. When you need to initialize (or update) the production database:
52+
53+
1. Authenticate the Supabase CLI (only required once per machine):
54+
55+
```bash
56+
npx supabase login
57+
```
58+
59+
1. Link the CLI to the production project (replace the placeholder reference):
60+
61+
```bash
62+
npx supabase link --project-ref your-production-project-ref --workdir suprabase
63+
```
64+
65+
1. Apply the latest migrations and RLS policies:
66+
67+
```bash
68+
npm run supabase:db:push
69+
```
70+
71+
The `supabase:db:push` script runs `supabase db push` against the linked project, ensuring every table, index, and policy in `suprabase/migrations` is kept in sync with production.
72+
3973
## Coding Standards
4074

4175
### Component Architecture

0 commit comments

Comments
 (0)