Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions e2e/routes.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { test, expect } from '@playwright/test';

test.describe('static pages', () => {
test('about page loads', async ({ page }) => {
await page.goto('/about-us');
await expect(page.locator('h1')).toContainText('About Us');
});

test('contact page displays form', async ({ page }) => {
await page.goto('/contact-us');
await expect(page.locator('form')).toBeVisible();
});

test('privacy policy page loads', async ({ page }) => {
await page.goto('/privacy-policy');
await expect(page.locator('h1')).toBeVisible();
});
});

test.describe('product pages', () => {
test('cw-air-th product page', async ({ page }) => {
await page.goto('/product/cw-air-th');
await expect(page.locator('h1')).toContainText('CropWatch Air Temperature');
});

test('cw-ss product page', async ({ page }) => {
await page.goto('/product/cw-ss');
await expect(page.locator('h1')).toContainText('CropWatch Soil Sensor');
});
});
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
"@eslint/compat": "^1.2.5",
"@eslint/js": "^9.18.0",
"@fontsource/fira-mono": "^5.0.0",
"@inlang/message-lint-rule-empty-pattern": "1",
"@inlang/message-lint-rule-identical-pattern": "1",
"@inlang/message-lint-rule-missing-translation": "1",
"@inlang/message-lint-rule-valid-js-identifier": "1",
"@inlang/message-lint-rule-without-source": "1",
"@inlang/plugin-m-function-matcher": "0",
"@inlang/plugin-message-format": "2",
"@neoconfetti/svelte": "^2.0.0",
"@playwright/test": "^1.49.1",
"@sveltejs/adapter-vercel": "^5.5.2",
Expand Down
10 changes: 5 additions & 5 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { defineConfig } from '@playwright/test';

export default defineConfig({
webServer: {
command: 'npm run build && npm run preview',
port: 4173
},
webServer: {
command: 'PUBLIC_RECAPTCHA_SITE_KEY=test PRIVATE_GOOGLE_RECAPTCHA_SECRET_KEY=test PRIVATE_EMAIL_HOST=localhost PRIVATE_EMAIL_PORT=1025 PRIVATE_EMAIL_USERNAME=user PRIVATE_EMAIL_PASSWORD=pass npm run build && npm run preview',
port: 4173
},

testDir: 'e2e'
testDir: 'e2e'
});
83 changes: 83 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions project.inlang/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"$schema": "https://inlang.com/schema/project-settings",
"modules": [
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-empty-pattern@1/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-identical-pattern@1/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-missing-translation@1/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-without-source@1/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-valid-js-identifier@1/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@2/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/plugin-m-function-matcher@0/dist/index.js"
],
"modules": [
"./node_modules/@inlang/message-lint-rule-empty-pattern/dist/index.js",
"./node_modules/@inlang/message-lint-rule-identical-pattern/dist/index.js",
"./node_modules/@inlang/message-lint-rule-missing-translation/dist/index.js",
"./node_modules/@inlang/message-lint-rule-without-source/dist/index.js",
"./node_modules/@inlang/message-lint-rule-valid-js-identifier/dist/index.js",
"./node_modules/@inlang/plugin-message-format/dist/index.js",
"./node_modules/@inlang/plugin-m-function-matcher/dist/index.js"
],
"plugin.inlang.messageFormat": {
"pathPattern": "./messages/{languageTag}.json"
},
Expand Down
31 changes: 31 additions & 0 deletions src/lib/components/vendor/animated-lines.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const globalAny: any = globalThis as any;
if (!globalAny.window) { globalAny.window = { addEventListener() {}, removeEventListener() {} }; }

import { describe, it, expect } from 'vitest';
import LinkedParticles from './animated-lines.js';

describe('LinkedParticles', () => {
it('initializes with the correct number of points', () => {
const ctx = {
canvas: {
width: 100,
height: 100,
addEventListener() {},
removeEventListener() {}
},
clearRect() {},
fillRect() {},
beginPath() {},
moveTo() {},
lineTo() {},
stroke() {},
closePath() {},
fill() {},
arc() {},
createLinearGradient() { return { addColorStop() {} }; }
} as unknown as CanvasRenderingContext2D;

const lp = new (LinkedParticles as any)(ctx);
expect(lp.points.length).toBe(lp.points_count);
});
});
13 changes: 13 additions & 0 deletions src/lib/data/products/cw-air-th.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { describe, it, expect } from 'vitest';
import cwAirThProduct from './cw-air-th';

describe('cwAirThProduct', () => {
it('includes basic product info', () => {
expect(cwAirThProduct.name).toBe('CropWatch Air Temperature & Humidity Sensor');
expect(cwAirThProduct.models[0].id).toBe('CW-AIR-TH');
});

it('lists standout features', () => {
expect(cwAirThProduct.standoutFeatures.length).toBeGreaterThan(0);
});
});
13 changes: 13 additions & 0 deletions src/lib/data/products/cw-ss.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { describe, it, expect } from 'vitest';
import cwSSProduct from './cw-ss';

describe('cwSSProduct', () => {
it('includes basic product info', () => {
expect(cwSSProduct.name).toBe('CropWatch Soil Sensor');
expect(cwSSProduct.models[0].id).toBe('CW-SS-TMEPNPK');
});

it('lists standout features', () => {
expect(cwSSProduct.standoutFeatures.length).toBeGreaterThan(0);
});
});
Loading