diff --git a/.gitignore b/.gitignore index 9a5aced..0b8ee3b 100644 --- a/.gitignore +++ b/.gitignore @@ -137,3 +137,7 @@ dist # Vite logs files vite.config.js.timestamp-* vite.config.ts.timestamp-* + +# Playwright artifacts +playwright-report/ +test-results/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 783b6a0..889642f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,28 +1,63 @@ # Contributing -## Rules +## Project Rules ### Naming Rules -- Use underscores for seperating words in filenames example and lowercasing only `line_graph.js` or `dashboard.js` +- Keep file names in lowercase +- Use underscores for multi-word names where appropriate (for example `line_graph.js`) -### Directory structure - -- Put all CSS(Cascading Style Sheet) into the `src//css` Folder the naming should be `css//feature_name.css` -- Put all Javascript files into the `src//js` Folder the naming should be `js//feature_name.js` -- All HTML Files are put directly into the `src//` Folder named as `src//feature_name.html` - -`` is the name of your component you are working on. +### Directory Structure +- Feature code belongs in `src/` +- Documentation belongs in `docs/` +- Organize feature files by component folder (for example `src//`) +- Keep HTML/CSS/JS close to the component where they are used +- Shared standards and quality rules are defined in this file ## Technologies ### CSS -- Bootstrap [bootstrap](https://getbootstrap.com/) +- Bootstrap: + +### JavaScript + +- Chart.js: + +## Tests and Quality + +### Prerequisites + +```bash +npm install +``` + +### Linting + +```bash +npm run lint +npm run lint:fix +``` + +### End-to-End Tests (Playwright) + +```bash +# Install browsers once +npm run test:e2e:install-browsers + +# Run all configured browser projects +npm run test:e2e -### Javascript +# Run a single browser project +npm run test:e2e:chrome +npm run test:e2e:edge +npm run test:e2e:firefox +``` -- We will use Charts.js for visualizing Data [chartjs](www.chartjs.org) +### Current Test Focus -## Development +- Dashboard view +- Menu navigation +- Smoke tests for Dashboard, Forms, and Tables +- Execution in Chrome, Edge, and Firefox diff --git a/README.md b/README.md index 92a57e8..02b2c68 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,48 @@ # BMI-Web-App -Lerneinheit LF10 +Learning unit LF10 -## Getting Started +## Who Is This App For? -Startet einen lokalen Webserver im Projektverzeichnis: +The BMI Web App is for users who want to calculate BMI values and review their entries in a simple browser-based interface. + +## Quick Start + +1. Start a local web server in the project root: ```bash python3 -m http.server 8000 ``` -Oeffnet dann im Browser: [http://localhost:8000](http://localhost:8000) +2. Open `http://localhost:8000` in your browser. +3. Use the menu to switch between `Dashboard`, `Forms`, and `Tables`. -> **Hinweis:** Die App muss ueber einen HTTP-Server laufen. Ein direktes Oeffnen der HTML-Dateien (`file://`) funktioniert nicht, da `fetch()`-Aufrufe eine Server-Umgebung benoetigen. +Note: Do not open the app via `file://`, because some content is loaded with `fetch()`. -## Documentation +## What The App Provides -Here you can find the links to the features in this software. +- BMI calculation with age, date, weight, and height inputs +- Automatic persistence of the latest values in `localStorage` +- Table view with filter and sort options for BMI entries +- Dashboard as a central entry point and overview + +## Views Overview - [Dashboard](./docs/Dashboard.md) +- [Formular](./docs/Formular.md) +- [Tables](./docs/Tables.md) - [Barchart](./docs/Barchart.md) -- [Linechart](./docs/Linechart.md) -- [Tables](./docs/Tables.md) -- [Settings](./docs/Settings.md) -- [Formular](./docs/Formular.md) \ No newline at end of file +- [Linechart](./docs/Linechart.md) +- [Settings](./docs/Settings.md) + +## Common Issues + +- **Blank page or loading errors:** start the app through an HTTP server (see Quick Start). +- **Outdated data:** clear browser `localStorage` or reset data inside the app. +- **Layout issues:** refresh the page and use an up-to-date browser version. + +## Developer Documentation + +Development standards, testing, and quality guidance: + +- [Contributing Guide](./CONTRIBUTING.md) +- [Documentation Index](./docs/README.md) \ No newline at end of file diff --git a/docs/Barchart.md b/docs/Barchart.md index f55a0c7..af01c64 100644 --- a/docs/Barchart.md +++ b/docs/Barchart.md @@ -1,3 +1,30 @@ -# Overview +# Barchart -The Barchart shows the historical development of BMI of the current user in bars over time. \ No newline at end of file +## Purpose + +The Barchart view visualizes BMI history as a bar chart. + +## What This View Provides + +- Visualization of BMI values over time +- Color-coded bars by BMI range +- Persistence of chart history in browser `localStorage` + +## Data Source + +- Uses local `bmiHistory` data from `localStorage` +- Height is currently a fixed value in the code +- Chart label/value source: + - `labels`: `entry.date` + - `data`: `entry.bmi` + +## User Flow + +1. Open the view +2. Existing `bmiHistory` data is rendered as bars +3. Reload the page and confirm the chart still renders persisted history + +## Technical Note + +`addBMI()` exists in `src/barchart/script.js`, but `src/barchart/barchart.html` currently has no input field or button that calls it. +In the current UI, this view is effectively read-only unless `addBMI()` is triggered externally. \ No newline at end of file diff --git a/docs/Dashboard.md b/docs/Dashboard.md index fcc17e7..e6e9307 100644 --- a/docs/Dashboard.md +++ b/docs/Dashboard.md @@ -1,51 +1,28 @@ -# Dashboard Documentation +# Dashboard -## Überblick +## Purpose -Das Dashboard ist die zentrale Übersichtsseite der BMI-Web-App. Es dient als Startpunkt der Anwendung und zeigt (aktuell als Platzhalter/Wireframe) typische Dashboard-Elemente wie Karten/Widgets, Charts und eine tabellarische Übersicht. Die Inhalte werden dynamisch in einen zentralen Content-Bereich geladen, ohne dass die komplette Seite neu geladen werden muss. +The Dashboard is the app entry view. It provides an overview and acts as the central navigation point. -## Ziel / Zweck +## What This View Provides -- **Schneller Einstieg** in die App über eine zentrale Oberfläche -- **Navigation** zu weiteren Bereichen (Forms, Tables) -- **Darstellung von Kennzahlen** (z.B. BMI-Verläufe, letzte Einträge) – derzeit als Platzhalter vorgesehen -- **Skalierbare Struktur**, damit später weitere Seiten/Widgets leicht ergänzt werden können +- Page title area: `Dashboard` +- Embedded Bar Chart iframe (`../barchart/barchart.html`) +- Embedded Line Chart iframe (`../line_chart/line_chart.html`) +- Embedded Tables iframe (`../tables/tables.html`) +- Sidebar navigation (`Dashboard`, `Forms`, `Tables`) ---- +## User Flow -## Projektstruktur (relevant) +1. Open the app and load Dashboard +2. Review embedded chart and table sections +3. Use the sidebar to switch views (`#dashboard`, `#formular`, `#tables`) -Typische Struktur (Auszug): +## Technical Note -- `index.html` (Projekt-Root) - Einstiegspunkt. Leitet auf die App weiter. +The route content is injected into `#view` by `src/dashboard/dashboard.js`. +Routing is hash-based and currently mapped as: -- `src/app.html` - Enthält Layout (Sidebar + Content-Area `#view`) und bindet CSS/JS ein. - -- `src/dashboard/dashboard.html` - Dashboard-Inhalt (Platzhalter-Layout, Cards/Charts/Tables-Bereiche). - -- `src/dashboard/dashboard.css` - Styling für Sidebar, Layout, Platzhalter-Komponenten. - -- `src/dashboard/dashboard.js` - Client-seitige Navigation (Routing) und dynamisches Nachladen der Seiten in `#view`. - -- `src/forms/forms.html` - Inhalt für den Forms-Bereich. - -- `src/tables/tables.html` - Inhalt für den Tables-Bereich. - ---- - -## Starten & Aufrufen - -### Lokaler Webserver - -Im Projekt-Root (dort wo `index.html` liegt) ausführen: - -```bash -python3 -m http.server 8000 -``` +- `#dashboard` -> `./dashboard/dashboard.html` +- `#formular` -> `./formular/formular.html` +- `#tables` -> `./tables/tables.html` diff --git a/docs/Formular.md b/docs/Formular.md index 3bfe596..71d6f06 100644 --- a/docs/Formular.md +++ b/docs/Formular.md @@ -1,30 +1,30 @@ -# BMI Form - Input Component +# Formular -## 📝 Project Description -This part of the BMI calculator is responsible for **user input**. Users can enter their personal data and calculate their BMI. +## Purpose -## 🎯 Features +This view collects user data and calculates BMI with a category result. -### Input Fields -- **Age** (1-120 years) -- **Date** (calculation date) -- **Weight** (1-500 kg) -- **Height** (50-250 cm) +## What This View Provides -### Buttons -- **BMI berechnen** - Starts the calculation -- **Clear/Reset** - Clears all inputs and results +- Input fields for: + - Age (1-120) + - Date + - Weight in kg (1-500) + - Height in cm (50-250) +- **BMI berechnen** button +- Button **Clear/Reset** +- Result area with BMI value and category +- Error area for invalid inputs -### Functionality -- ✅ **Input Validation** - Checks for empty fields and valid values -- ✅ **BMI Calculation** - Formula: `Weight / (Height/100)²` -- ✅ **BMI Categories** - Underweight, Normal weight, Overweight, Obesity -- ✅ **Local Storage** - Saves inputs in browser -- ✅ **Auto-Load** - Loads saved data on page start -- ✅ **Responsive Design** - Works on desktop and mobile +## Logic and Behavior +- Inputs are validated before calculation +- BMI formula: `weight / (height in m)^2` +- Category mapping: Underweight, Normal weight, Overweight, Obesity +- Each calculation is appended to `localStorage['bmiData']` as a history entry +- On load, the last history entry is restored into the form -## 🚀 Usage +## User Flow 1. Open `formular.html` in browser 2. Fill all 4 input fields @@ -33,39 +33,40 @@ This part of the BMI calculator is responsible for **user input**. Users can ent 5. On reload: Data is still there 6. "Clear/Reset" deletes all data +## Local Storage -## 💾 LocalStorage +**Key:** `localStorage['bmiData']` -**Speicherort:** `localStorage['bmiData']` - -Daten werden nach der Berechnung als JSON-String gespeichert: +Data is saved as a JSON array after each calculation: ```json -{ +[ + { "age": "25", "date": "2025-02-23", "weight": "75", "height": "180", "bmi": 23.1, "category": "Normalgewicht", - "timestamp": "2025-02-23T14:30:45.123Z" // new Date().toISOString() -} + "timestamp": "2025-02-23T14:30:45.123Z" + } +] ``` -### Daten extrahieren +### Read Data ```javascript -// Einfaches Auslesen -const data = JSON.parse(localStorage.getItem('bmiData')); -console.log(data.bmi, data.category); - -// Mit Null-Check -if (localStorage.getItem('bmiData')) { - const data = JSON.parse(localStorage.getItem('bmiData')); - console.log('Gespeicherte Daten:', data); +// Read full history +const history = JSON.parse(localStorage.getItem("bmiData") || "[]"); +console.log(history.length); + +// Read last entry +if (history.length > 0) { + const latest = history[history.length - 1]; + console.log(latest.bmi, latest.category); } ``` -### Daten löschen +### Delete Data ```javascript -localStorage.removeItem('bmiData'); +localStorage.removeItem("bmiData"); ``` \ No newline at end of file diff --git a/docs/Linechart.md b/docs/Linechart.md index 11f5e60..4497cc1 100644 --- a/docs/Linechart.md +++ b/docs/Linechart.md @@ -1,15 +1,23 @@ -# Overview +# Linechart -The line chart visualizes the BMI Data over time. +## Purpose -## Data +The Linechart view shows BMI values as a trend line over time. -Currently the data uses a mock object which contains all datapoints. Later on it should read the necessary data -from the local storage. +## What This View Provides -# Integration +- BMI data visualization as a line chart +- Rendering on a `canvas` element +- Trend-based view instead of single-value focus -To integrate the line chart into the dashboard you can either use -the id `bmi-chart` __or__ you can call the javascript function `plotChart` with a different canvas id. +## Current Data State -__NOTE__: The Linechart must be a element of type `` +- `plotChart("bmi-chart")` is executed on load +- The implementation reads `localStorage['bmiData']` into `rawPlotData` +- Current chart configuration references `plotData`, which is not defined in the file + +## Integration Notes + +- Chart logic expects a `canvas` element +- Default canvas id in this view: `bmi-chart` +- Without a defined `plotData` source, the current implementation may fail at runtime diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..d68bdc7 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,21 @@ +# Documentation Index + +This folder contains the feature and view documentation for the BMI Web App. + +## Quick Start + +- Start with [Dashboard](./Dashboard.md) to understand the app entry view and navigation. +- Continue with [Formular](./Formular.md) for BMI input and calculation flow (menu label: `Forms`, route: `#formular`). +- Use [Tables](./Tables.md) for filtering and sorting BMI entries. +- Check [Barchart](./Barchart.md) for BMI history visualization. +- Review [Linechart](./Linechart.md) for trend visualization details. +- Open [Settings](./Settings.md) for persisted user preferences. + +## Recommended Reading Order + +1. [Dashboard](./Dashboard.md) +2. [Formular](./Formular.md) +3. [Tables](./Tables.md) +4. [Barchart](./Barchart.md) +5. [Linechart](./Linechart.md) +6. [Settings](./Settings.md) diff --git a/docs/Settings.md b/docs/Settings.md index 3324766..ba821d7 100644 --- a/docs/Settings.md +++ b/docs/Settings.md @@ -1,133 +1,47 @@ -# Settings Feature Dokumentation +# Settings -## Übersicht -Das Settings-Feature ermöglicht es Benutzern, ihre persönlichen Einstellungen sowie Diagramm-Präferenzen zu speichern und zu verwalten. Alle Einstellungen werden persistent im Browser-localStorage gespeichert. +## Purpose ---- +The Settings view stores basic user preferences in browser `localStorage`. -## 1. User Settings +## What This View Provides -### Beschreibung -Verwaltet benutzerspezifische Einstellungen wie das Geschlecht. Nach jeder Änderung werden die Daten automatisch im localStorage gespeichert und bleiben auch nach einem Neustart der Anwendung erhalten. +- A dialog that can be opened and closed +- A gender selector with values `none`, `male`, and `female` +- Persistent settings storage under `userSettings` +- A separate graph type toggle feature stored under `graphType` (`bar` or `line`) -### LocalStorage Struktur -**Key:** `userSettings` +## Data Model + +### `userSettings` -**Value:** ```json { - "gender": "none" | "male" | "female" -} -``` - -### Implementation - -#### Initialisierung -```javascript -// Standard-Einstellungen -let settings = { - gender: 'none' -}; -``` - -#### Laden aus LocalStorage -```javascript -function loadSettingsFromStorage() { - const savedSettings = localStorage.getItem('userSettings'); - if (savedSettings) { - try { - settings = JSON.parse(savedSettings); - } catch (error) { - console.error('Fehler beim Laden der Einstellungen:', error); - } - } -} -``` - -#### Speichern in LocalStorage -```javascript -function saveSettingsToStorage() { - try { - localStorage.setItem('userSettings', JSON.stringify(settings)); - } catch (error) { - console.error('Fehler beim Speichern der Einstellungen:', error); - } + "gender": "none" } ``` -#### Verwendungsbeispiel -```javascript -// Beim Laden der Seite -document.addEventListener('DOMContentLoaded', () => { - loadSettingsFromStorage(); - applySettings(); -}); - -// Bei Änderung der Einstellungen -function updateGender(newGender) { - settings.gender = newGender; - saveSettingsToStorage(); -} -``` - ---- +### `graphType` -## 2. Graph Type Button +Saved by the graph type toggle feature: -### Beschreibung -Ermöglicht dem Benutzer, zwischen verschiedenen Diagrammtypen (Balkendiagramm oder Liniendiagramm) zu wechseln. Die Auswahl wird im localStorage gespeichert und beim nächsten Besuch wieder geladen. +- `bar` +- `line` -### LocalStorage Struktur -**Key:** `graphType` +## User Flow -**Value:** `'bar'` oder `'line'` +1. Click **Einstellungen** to open the dialog +2. Choose a gender value +3. Close the dialog +4. Re-open the app and confirm the setting is still selected -### Implementation - -#### Initialisierung -```javascript -// Standard-Diagrammtyp -let graphType = 'bar'; -``` +Graph type flow (separate view): -#### Laden aus LocalStorage -```javascript -function loadGraphTypeFromStorage() { - const savedGraphType = localStorage.getItem('graphType'); - if (savedGraphType) { - try { - graphType = JSON.parse(savedGraphType); - } catch (error) { - console.error('Fehler beim Laden des Diagrammtyps:', error); - graphType = 'bar'; // Fallback zum Standard - } - } -} -``` +1. Open `settings/graphType/graphTypeBtn.html` +2. Click the button to toggle between bar and line +3. Re-open and verify persisted button state -#### Speichern in LocalStorage -```javascript -function saveGraphTypeToStorage(type) { - try { - localStorage.setItem('graphType', JSON.stringify(type)); - } catch (error) { - console.error('Fehler beim Speichern des Diagrammtyps:', error); - } -} -``` +## Technical Note -#### Verwendungsbeispiel -```javascript -// Beim Laden der Seite -document.addEventListener('DOMContentLoaded', () => { - loadGraphTypeFromStorage(); - renderGraph(graphType); -}); - -// Bei Klick auf den Button -function toggleGraphType() { - graphType = graphType === 'bar' ? 'line' : 'bar'; - saveGraphTypeToStorage(graphType); - renderGraph(graphType); -} -``` \ No newline at end of file +Settings are loaded on `DOMContentLoaded` and updated when the selected value changes. +Both settings and graph type use inline `onclick` handlers in the current HTML. \ No newline at end of file diff --git a/docs/Tables.md b/docs/Tables.md index e69de29..43ac659 100644 --- a/docs/Tables.md +++ b/docs/Tables.md @@ -0,0 +1,35 @@ +# Tables + +## Purpose + +The Tables view displays BMI measurements in a structured format and supports fast filtering and sorting. + +## What This View Provides + +- Table columns: + - Date + - Weight + - Height + - Calculated BMI + - BMI rating +- Filters: + - All entries + - Last week + - Last month +- Sorting: + - Date ascending/descending + - BMI ascending/descending +- Delete action per row + +## Data Basis + +- Data is loaded from `localStorage['bmiData']` +- `bmiData` is expected to be an array of entries (written by Formular) +- BMI is recalculated per row from weight and height during rendering +- Deleting a row updates both the table and `localStorage` + +## User Flow + +1. Open the table view +2. Optionally apply filters and sorting +3. Compare or delete entries diff --git a/index.html b/index.html new file mode 100644 index 0000000..75bc493 --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + + + BMI-Web-App + + + + + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 94d7e2f..81b9547 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,34 +1,949 @@ { - "name": "BMI-Web-App", + "name": "bmi-web-app", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { - "node_modules/@popperjs/core": { - "version": "2.11.8", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", - "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", - "peer": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/popperjs" - } - }, - "node_modules/bootstrap": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.8.tgz", - "integrity": "sha512-HP1SZDqaLDPwsNiqRqi5NcP0SSXciX2s9E+RyqJIIqGo+vJeN5AJVM98CXmW/Wux0nQ5L7jeWUdplCEf0Ee+tg==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/twbs" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/bootstrap" + "": { + "name": "bmi-web-app", + "version": "1.0.0", + "license": "ISC", + "devDependencies": { + "@eslint/js": "^10.0.1", + "@playwright/test": "^1.58.2", + "eslint": "^10.0.1", + "globals": "^17.3.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.2.tgz", + "integrity": "sha512-YF+fE6LV4v5MGWRGj7G404/OZzGNepVF8fxk7jqmqo3lrza7a0uUcDnROGRBG1WFC1omYUS/Wp1f42i0M+3Q3A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^3.0.2", + "debug": "^4.3.1", + "minimatch": "^10.2.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.5.2.tgz", + "integrity": "sha512-a5MxrdDXEvqnIq+LisyCX6tQMPF/dSJpCfBgBauY+pNZ28yCtSsTvyTYrMhaI+LK26bVyCJfJkT0u8KIj2i1dQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.1.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/core": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.1.0.tgz", + "integrity": "sha512-/nr9K9wkr3P1EzFTdFdMoLuo1PmIxjmwvPozwoSodjNBdefGujXQUF93u1DDZpEaTuDvMsIQddsd35BwtrW9Xw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/js": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "eslint": "^10.0.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/@eslint/object-schema": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.2.tgz", + "integrity": "sha512-HOy56KJt48Bx8KmJ+XGQNSUMT/6dZee/M54XyUyuvTvPXJmsERRvBchsUVx1UMe1WwIH49XLAczNC7V2INsuUw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.6.0.tgz", + "integrity": "sha512-bIZEUzOI1jkhviX2cp5vNyXQc6olzb2ohewQubuYlMXZ2Q/XjBO0x0XhGPvc9fjSIiUN0vw+0hq53BJ4eQSJKQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.1.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@playwright/test": { + "version": "1.58.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.58.2.tgz", + "integrity": "sha512-akea+6bHYBBfA9uQqSYmlJXn61cTa+jbO87xVLCWbTqbWadRVmhxlXATaOjOgcBaWU4ePo0wB41KMFv3o35IXA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.58.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@types/esrecurse": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz", + "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz", + "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/brace-expansion": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.3.tgz", + "integrity": "sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true } - ], + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.0.1.tgz", + "integrity": "sha512-20MV9SUdeN6Jd84xESsKhRly+/vxI+hwvpBMA93s+9dAcjdCuCojn4IqUGS3lvVaqjVYGYHSRMCpeFtF2rQYxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.2", + "@eslint/config-array": "^0.23.2", + "@eslint/config-helpers": "^0.5.2", + "@eslint/core": "^1.1.0", + "@eslint/plugin-kit": "^0.6.0", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.12.4", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^9.1.1", + "eslint-visitor-keys": "^5.0.1", + "espree": "^11.1.1", + "esquery": "^1.7.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "minimatch": "^10.2.1", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, "peerDependencies": { - "@popperjs/core": "^2.11.8" + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.1.tgz", + "integrity": "sha512-GaUN0sWim5qc8KVErfPBWmc31LEsOkrUJbvJZV+xuL3u2phMUK4HIvXlWAakfC8W4nzlK+chPEAkYOYb5ZScIw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@types/esrecurse": "^4.3.1", + "@types/estree": "^1.0.8", + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-11.1.1.tgz", + "integrity": "sha512-AVHPqQoZYc+RUM4/3Ly5udlZY/U4LS8pIG05jEjWM2lQMU/oaZ7qshzAl2YP1tfNmXfftH3ohurfwNAug+MnsQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.16.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^5.0.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.3.0.tgz", + "integrity": "sha512-yMqGUQVVCkD4tqjOJf3TnrvaaHDMYp4VlUSObbkIiuCPe/ofdMBFIAcBbCSRFWOnos6qRiTVStDwqPLUclaxIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", + "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/playwright": { + "version": "1.58.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.58.2.tgz", + "integrity": "sha512-vA30H8Nvkq/cPBnNw4Q8TWz1EJyqgpuinBcHET0YVJVFldr8JDNiU9LaWAE1KqSkRYazuaBhTpB5ZzShOezQ6A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.58.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.58.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.58.2.tgz", + "integrity": "sha512-yZkEtftgwS8CsfYo7nm0KE8jsvm6i/PTgVtB8DL726wNf6H2IMsDuxCpJj59KDaxCtSnrWan2AeDqM7JBaultg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } } } diff --git a/package.json b/package.json new file mode 100644 index 0000000..8f1b004 --- /dev/null +++ b/package.json @@ -0,0 +1,38 @@ +{ + "name": "bmi-web-app", + "version": "1.0.0", + "description": "Lerneinheit LF10", + "main": "index.js", + "directories": { + "doc": "docs" + }, + "scripts": { + "lint": "eslint \"src/**/*.js\"", + "lint:fix": "eslint \"src/**/*.js\" --fix", + "lint:report": "eslint \"src/**/*.js\" --format stylish", + "test:e2e": "playwright test", + "test:e2e:ui": "playwright test --ui", + "test:e2e:headed": "playwright test --headed", + "test:e2e:chrome": "playwright test --project=chrome", + "test:e2e:edge": "playwright test --project=edge", + "test:e2e:firefox": "playwright test --project=firefox", + "test:e2e:install-browsers": "playwright install chrome msedge firefox" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/biancode/BMI-Web-App.git" + }, + "keywords": [], + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/biancode/BMI-Web-App/issues" + }, + "homepage": "https://github.com/biancode/BMI-Web-App#readme", + "devDependencies": { + "@eslint/js": "^10.0.1", + "@playwright/test": "^1.58.2", + "eslint": "^10.0.1", + "globals": "^17.3.0" + } +} diff --git a/playwright.config.js b/playwright.config.js new file mode 100644 index 0000000..0a30238 --- /dev/null +++ b/playwright.config.js @@ -0,0 +1,33 @@ +const { defineConfig, devices } = require("@playwright/test"); + +module.exports = defineConfig({ + testDir: "./tests/e2e", + fullyParallel: true, + reporter: [["list"], ["html", { open: "never" }]], + use: { + baseURL: "http://127.0.0.1:4173", + trace: "on-first-retry", + screenshot: "only-on-failure", + video: "retain-on-failure", + }, + webServer: { + command: "python3 -m http.server 4173", + url: "http://127.0.0.1:4173", + reuseExistingServer: !process.env.CI, + timeout: 30_000, + }, + projects: [ + { + name: "chrome", + use: { ...devices["Desktop Chrome"], channel: "chrome" }, + }, + { + name: "edge", + use: { ...devices["Desktop Edge"], channel: "msedge" }, + }, + { + name: "firefox", + use: { ...devices["Desktop Firefox"], browserName: "firefox" }, + }, + ], +}); diff --git a/src/dashboard/dashboard.js b/src/dashboard/dashboard.js index d84f6a1..dd6a1e0 100644 --- a/src/dashboard/dashboard.js +++ b/src/dashboard/dashboard.js @@ -58,6 +58,8 @@ function shouldRewrite(url) { } function resolvePath(url, baseDir) { + // baseDir is e.g. "./dashboard/" + // document path is /src/index.html -> resolved paths become /src/dashboard/... const base = new URL(baseDir, window.location.href); const resolved = new URL(url, base); return `${resolved.pathname}${resolved.search}${resolved.hash}`; diff --git a/tests/e2e/dashboard-menu.spec.js b/tests/e2e/dashboard-menu.spec.js new file mode 100644 index 0000000..2b9702f --- /dev/null +++ b/tests/e2e/dashboard-menu.spec.js @@ -0,0 +1,40 @@ +const { test, expect } = require("@playwright/test"); + +test.describe("Dashboard und Menü Navigation", () => { + test("lädt standardmäßig das Dashboard und zeigt Menü", async ({ page }) => { + await page.goto("/src/index.html"); + + await expect(page.locator("#sidebarNav")).toBeVisible(); + await expect(page.getByRole("link", { name: "Dashboard" })).toBeVisible(); + await expect(page.getByRole("link", { name: "Forms" })).toBeVisible(); + await expect(page.getByRole("link", { name: "Tables" })).toBeVisible(); + + await expect(page.locator("#view")).toContainText("Dashboard"); + await expect(page.locator("#sidebarNav a.active")).toHaveText("Dashboard"); + }); + + test("navigiert über das Menü zwischen allen Views", async ({ page }) => { + await page.goto("/src/index.html#dashboard"); + + await page.getByRole("link", { name: "Forms" }).click(); + await expect(page).toHaveURL(/#formular$/); + await expect(page.locator("#sidebarNav a.active")).toHaveText("Forms"); + await expect(page.locator("#view")).toContainText(/BMI Formular/); + + await page.getByRole("link", { name: "Tables" }).click(); + await expect(page).toHaveURL(/#tables$/); + await expect(page.locator("#sidebarNav a.active")).toHaveText("Tables"); + await expect(page.locator("#view")).toContainText(/BMI|Messungen|Datum/); + + await page.getByRole("link", { name: "Dashboard" }).click(); + await expect(page).toHaveURL(/#dashboard$/); + await expect(page.locator("#sidebarNav a.active")).toHaveText("Dashboard"); + await expect(page.locator("#view")).toContainText("Dashboard"); + }); + + test("fällt bei ungültiger Route auf Dashboard zurück", async ({ page }) => { + await page.goto("/src/index.html#does-not-exist"); + await expect(page.locator("#sidebarNav a.active")).toHaveText("Dashboard"); + await expect(page.locator("#view")).toContainText("Dashboard"); + }); +}); diff --git a/tests/e2e/view-smoke.spec.js b/tests/e2e/view-smoke.spec.js new file mode 100644 index 0000000..81417b4 --- /dev/null +++ b/tests/e2e/view-smoke.spec.js @@ -0,0 +1,31 @@ +const { test, expect } = require("@playwright/test"); + +const views = [ + { + name: "Dashboard View", + hash: "#dashboard", + activeLink: "Dashboard", + expectedText: "Dashboard", + }, + { + name: "Forms View", + hash: "#formular", + activeLink: "Forms", + expectedText: /BMI Formular/, + }, + { + name: "Tables View", + hash: "#tables", + activeLink: "Tables", + expectedText: /BMI|Messungen|Datum/, + }, +]; + +for (const view of views) { + test(`${view.name} rendert korrekt`, async ({ page }) => { + await page.goto(`/src/index.html${view.hash}`); + + await expect(page.locator("#sidebarNav a.active")).toHaveText(view.activeLink); + await expect(page.locator("#view")).toContainText(view.expectedText); + }); +}