lightnet 4.0.0 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.json +11 -1
  3. package/__e2e__/admin.spec.ts +0 -20
  4. package/__e2e__/basics-fixture.ts +0 -23
  5. package/__e2e__/fixtures/basics/astro.config.mjs +0 -35
  6. package/__e2e__/fixtures/basics/node_modules/.bin/astro +0 -21
  7. package/__e2e__/fixtures/basics/node_modules/.bin/tailwind +0 -21
  8. package/__e2e__/fixtures/basics/node_modules/.bin/tailwindcss +0 -21
  9. package/__e2e__/fixtures/basics/node_modules/.bin/tsc +0 -21
  10. package/__e2e__/fixtures/basics/node_modules/.bin/tsserver +0 -21
  11. package/__e2e__/fixtures/basics/package.json +0 -22
  12. package/__e2e__/fixtures/basics/public/favicon.svg +0 -1
  13. package/__e2e__/fixtures/basics/public/files/example.pdf +0 -0
  14. package/__e2e__/fixtures/basics/src/assets/logo.png +0 -0
  15. package/__e2e__/fixtures/basics/src/content/categories/christian-living.json +0 -6
  16. package/__e2e__/fixtures/basics/src/content/categories/teens.json +0 -6
  17. package/__e2e__/fixtures/basics/src/content/categories/theology.json +0 -6
  18. package/__e2e__/fixtures/basics/src/content/media/faithful-freestyle--en.json +0 -17
  19. package/__e2e__/fixtures/basics/src/content/media/how-to-kickflip--de.json +0 -17
  20. package/__e2e__/fixtures/basics/src/content/media/images/cover.jpg +0 -0
  21. package/__e2e__/fixtures/basics/src/content/media/images/how-to-kickflip--en.webp +0 -0
  22. package/__e2e__/fixtures/basics/src/content/media/skate-sounds--en.json +0 -21
  23. package/__e2e__/fixtures/basics/src/content/media-collections/how-to-articles.json +0 -7
  24. package/__e2e__/fixtures/basics/src/content/media-types/audio.json +0 -10
  25. package/__e2e__/fixtures/basics/src/content/media-types/book.json +0 -15
  26. package/__e2e__/fixtures/basics/src/content/media-types/video.json +0 -10
  27. package/__e2e__/fixtures/basics/src/content.config.ts +0 -3
  28. package/__e2e__/fixtures/basics/src/pages/[locale]/index.astro +0 -15
  29. package/__e2e__/fixtures/basics/src/translations/de.yml +0 -1
  30. package/__e2e__/fixtures/basics/src/translations/en.yml +0 -1
  31. package/__e2e__/fixtures/basics/tailwind.config.mjs +0 -8
  32. package/__e2e__/global.teardown.ts +0 -5
  33. package/__e2e__/homepage.spec.ts +0 -123
  34. package/__e2e__/search.spec.ts +0 -14
  35. package/__tests__/astro-integration/config.spec.ts +0 -364
  36. package/__tests__/astro-integration/integration.spec.ts +0 -125
  37. package/__tests__/astro-integration/tailwind.spec.ts +0 -36
  38. package/__tests__/content/content-schema.spec.ts +0 -109
  39. package/__tests__/content/get-media-collections.spec.ts +0 -72
  40. package/__tests__/content/query-media-items.spec.ts +0 -213
  41. package/__tests__/i18n/resolve-current-locale.spec.ts +0 -65
  42. package/__tests__/i18n/translate-map.spec.ts +0 -19
  43. package/__tests__/i18n/translate.spec.ts +0 -91
  44. package/__tests__/pages/details-page/create-content-metadata.spec.ts +0 -153
  45. package/__tests__/pages/details-page/get-translations.spec.ts +0 -56
  46. package/__tests__/utils/markdown.spec.ts +0 -74
  47. package/__tests__/utils/paths.spec.ts +0 -116
  48. package/__tests__/utils/urls.spec.ts +0 -32
  49. package/playwright.config.ts +0 -31
  50. package/vitest.config.js +0 -36
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # lightnet
2
2
 
3
+ ## 4.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#370](https://github.com/LightNetDev/LightNet/pull/370) [`1256c94`](https://github.com/LightNetDev/LightNet/commit/1256c94010948c2ab09f51ce26dfd5ed90e6e3e8) Thanks [@smn-cds](https://github.com/smn-cds)! - Publish the LightNet v4 documentation.
8
+
9
+ For upgrade steps, see https://docs.lightnet.community/run/upgrade-to/v4/
10
+
11
+ ## 4.0.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#368](https://github.com/LightNetDev/LightNet/pull/368) [`e47f57b`](https://github.com/LightNetDev/LightNet/commit/e47f57b620ef269f49341e976d71b50e42c23f8a) Thanks [@smn-cds](https://github.com/smn-cds)! - Limit published package contents to runtime files only.
16
+
3
17
  ## 4.0.0
4
18
 
5
19
  ### Major Changes
package/package.json CHANGED
@@ -3,12 +3,15 @@
3
3
  "description": "LightNet makes it easy to run your own digital media library.",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
- "version": "4.0.0",
6
+ "version": "4.0.2",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "https://github.com/LightNetDev/lightnet",
10
10
  "directory": "packages/lightnet"
11
11
  },
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
12
15
  "bugs": {
13
16
  "url": "https://github.com/LightNetDev/lightnet/issues"
14
17
  },
@@ -16,6 +19,13 @@
16
19
  "keywords": [
17
20
  "astro-integration"
18
21
  ],
22
+ "files": [
23
+ "exports",
24
+ "src",
25
+ "tailwind.config.ts",
26
+ "README.md",
27
+ "CHANGELOG.md"
28
+ ],
19
29
  "exports": {
20
30
  ".": "./exports/index.ts",
21
31
  "./content": "./exports/content.ts",
@@ -1,20 +0,0 @@
1
- import { expect } from "@playwright/test"
2
-
3
- import { test } from "./basics-fixture"
4
-
5
- test.describe("Edit button on details page", () => {
6
- test("Should not show `Edit` button on details page by default.", async ({
7
- page,
8
- lightnet,
9
- }) => {
10
- await lightnet()
11
-
12
- await page.getByRole("link", { name: "Faithful Freestyle" }).click()
13
- await expect(
14
- page.getByRole("heading", { name: "Faithful Freestyle" }),
15
- ).toBeVisible()
16
-
17
- const editButton = page.locator("#edit-btn")
18
- await expect(editButton).toBeHidden()
19
- })
20
- })
@@ -1,23 +0,0 @@
1
- import {
2
- type AstroFixturePage as LightNetPage,
3
- createAstroFixturePage,
4
- resolveFixturePath,
5
- } from "@internal/e2e-test-utils"
6
- import { test as baseTest } from "@playwright/test"
7
-
8
- export { expect, type Locator } from "@playwright/test"
9
-
10
- const root = resolveFixturePath(import.meta.url, "./fixtures/basics/")
11
-
12
- const test = baseTest.extend<{
13
- lightnet: (path?: string) => Promise<LightNetPage>
14
- }>({
15
- lightnet: ({ page }, use) =>
16
- use(async (path) => {
17
- const ln = await createAstroFixturePage(root, page)
18
- await ln.goto(path ?? "/")
19
- return ln
20
- }),
21
- })
22
-
23
- export { test }
@@ -1,35 +0,0 @@
1
- // @ts-check
2
- import { defineConfig } from "astro/config"
3
- import lightnet from "lightnet"
4
-
5
- // https://astro.build/config
6
- export default defineConfig({
7
- site: "https://lightnet.community",
8
- integrations: [
9
- lightnet({
10
- logo: { src: "./src/assets/logo.png" },
11
- title: { en: "Basic Test", de: "Basic Test" },
12
- languages: [
13
- {
14
- code: "en",
15
- label: { en: "English", de: "English" },
16
- isDefaultSiteLanguage: true,
17
- },
18
- {
19
- code: "de",
20
- label: { en: "Deutsch", de: "Deutsch" },
21
- isSiteLanguage: true,
22
- },
23
- ],
24
- favicon: [{ href: "favicon.svg" }],
25
- credits: true,
26
- mainMenu: [
27
- {
28
- href: "/",
29
- label: { en: "Home", de: "Startseite" },
30
- },
31
- { href: "/media", label: { en: "Search", de: "Suche" } },
32
- ],
33
- }),
34
- ],
35
- })
@@ -1,21 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@6.1.1_@types+node@24.12.0_jiti@1.21.7_rollup@4.60.1_typescript@5.9.3_yaml@2.8.3/node_modules/astro/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@6.1.1_@types+node@24.12.0_jiti@1.21.7_rollup@4.60.1_typescript@5.9.3_yaml@2.8.3/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@6.1.1_@types+node@24.12.0_jiti@1.21.7_rollup@4.60.1_typescript@5.9.3_yaml@2.8.3/node_modules/astro/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@6.1.1_@types+node@24.12.0_jiti@1.21.7_rollup@4.60.1_typescript@5.9.3_yaml@2.8.3/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- if [ -x "$basedir/node" ]; then
18
- exec "$basedir/node" "$basedir/../astro/bin/astro.mjs" "$@"
19
- else
20
- exec node "$basedir/../astro/bin/astro.mjs" "$@"
21
- fi
@@ -1,21 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/tailwindcss@3.4.19_yaml@2.8.3/node_modules/tailwindcss/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/tailwindcss@3.4.19_yaml@2.8.3/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/tailwindcss@3.4.19_yaml@2.8.3/node_modules/tailwindcss/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/tailwindcss@3.4.19_yaml@2.8.3/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- if [ -x "$basedir/node" ]; then
18
- exec "$basedir/node" "$basedir/../tailwindcss/lib/cli.js" "$@"
19
- else
20
- exec node "$basedir/../tailwindcss/lib/cli.js" "$@"
21
- fi
@@ -1,21 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/tailwindcss@3.4.19_yaml@2.8.3/node_modules/tailwindcss/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/tailwindcss@3.4.19_yaml@2.8.3/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/tailwindcss@3.4.19_yaml@2.8.3/node_modules/tailwindcss/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/tailwindcss@3.4.19_yaml@2.8.3/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- if [ -x "$basedir/node" ]; then
18
- exec "$basedir/node" "$basedir/../tailwindcss/lib/cli.js" "$@"
19
- else
20
- exec node "$basedir/../tailwindcss/lib/cli.js" "$@"
21
- fi
@@ -1,21 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- if [ -x "$basedir/node" ]; then
18
- exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
19
- else
20
- exec node "$basedir/../typescript/bin/tsc" "$@"
21
- fi
@@ -1,21 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- if [ -x "$basedir/node" ]; then
18
- exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
19
- else
20
- exec node "$basedir/../typescript/bin/tsserver" "$@"
21
- fi
@@ -1,22 +0,0 @@
1
- {
2
- "name": "@e2e/basics",
3
- "type": "module",
4
- "version": "0.0.1",
5
- "private": "true",
6
- "scripts": {
7
- "dev": "astro dev"
8
- },
9
- "dependencies": {
10
- "@astrojs/react": "^5.0.2",
11
- "astro": "^6.1.1",
12
- "lightnet": "^4.0.0",
13
- "react": "^19.2.4",
14
- "react-dom": "^19.2.4",
15
- "sharp": "^0.34.5",
16
- "tailwindcss": "^3.4.19",
17
- "typescript": "^5.9.3"
18
- },
19
- "engines": {
20
- "node": ">=22"
21
- }
22
- }
@@ -1 +0,0 @@
1
- <svg width="1000" height="1000" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><rect width="1000" height="1000" rx="50" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M125 75c-27.614 0-50 22.386-50 50v699.786l583.089-583.089c7.03-7.03 18.427-7.03 25.456 0l54.261 54.261c7.03 7.029 7.03 18.426 0 25.456L134.22 925H875c27.614 0 50-22.386 50-50V125c0-27.614-22.386-50-50-50H125Zm497.912 420.321c-43.19 13.289-66.806 59.165-52.965 102.523 13.871 43.106 59.913 67.443 103.104 54.155 43.051-13.428 66.806-59.164 52.851-102.409-5.509-17.636-16.528-32.088-30.648-42.055-20.238-14.757-46.817-20.072-72.315-12.181l-.027-.033Zm48.422 71.125c4.153 12.957-2.935 26.745-15.891 30.732-12.93 4.015-26.772-3.295-30.925-16.251-4.153-12.957 2.934-26.745 15.891-30.732 12.957-3.986 26.772 3.295 30.925 16.251Z" fill="url(#b)"/></g><defs><linearGradient id="b" x1="897" y1="98.923" x2="75" y2="934.345" gradientUnits="userSpaceOnUse"><stop stop-color="#2D03A4"/><stop offset="1" stop-color="#25212C"/></linearGradient><clipPath id="a"><path fill="#fff" d="M0 0h1000v1000H0z"/></clipPath></defs></svg>
@@ -1,6 +0,0 @@
1
- {
2
- "label": {
3
- "en": "Christian Living",
4
- "de": "Glaube leben"
5
- }
6
- }
@@ -1,6 +0,0 @@
1
- {
2
- "label": {
3
- "en": "Teens",
4
- "de": "Teens"
5
- }
6
- }
@@ -1,6 +0,0 @@
1
- {
2
- "label": {
3
- "en": "Theology",
4
- "de": "Theologie"
5
- }
6
- }
@@ -1,17 +0,0 @@
1
- {
2
- "commonId": "faithful-freestyle",
3
- "title": "Faithful Freestyle",
4
- "type": "book",
5
- "dateCreated": "2024-04-21",
6
- "authors": ["Sk8 Ministries"],
7
- "content": [
8
- {
9
- "type": "upload",
10
- "url": "/files/example.pdf"
11
- }
12
- ],
13
- "image": "./images/cover.jpg",
14
- "language": "en",
15
- "categories": ["christian-living"],
16
- "description": "*How to: Faithful Freestyle* empowers you to express your Christianity through the unique and creative outlet of skateboarding. This book includes:\n\n* **Creative ways to incorporate faith** into your skating routines\n* **Stories of freestyle skaters** who honor God through their sport\n* **Practical advice on witnessing** to others in the skateboarding scene\n* **Inspirational devotions** designed for skaters\n\nEmbrace a faithful freestyle and let every trick and turn reflect your devotion to Christ."
17
- }
@@ -1,17 +0,0 @@
1
- {
2
- "commonId": "how-to-kickflip",
3
- "title": "Kickflip Anleitung",
4
- "type": "video",
5
- "dateCreated": "2024-04-21",
6
- "content": [
7
- {
8
- "type": "link",
9
- "url": "https://www.youtube.com/watch?v=tnpLkUQZODc"
10
- }
11
- ],
12
- "image": "./images/how-to-kickflip--en.webp",
13
- "authors": ["Skiddy Skates"],
14
- "language": "de",
15
- "categories": ["teens"],
16
- "description": "Dieses Tutorial zeigt dir, wie du den Kickflip meisterst. Es behandelt den Stand, das Abpoppen, das Flicking, das Timing und das Landen. Perfekt für alle Könnensstufen!"
17
- }
@@ -1,21 +0,0 @@
1
- {
2
- "commonId": "skate-sounds",
3
- "title": "Skate Sounds",
4
- "type": "audio",
5
- "dateCreated": "2024-04-21",
6
- "authors": ["Sk8 Ministries"],
7
- "content": [
8
- {
9
- "type": "upload",
10
- "url": "/files/example-audio.mp3"
11
- },
12
- {
13
- "type": "link",
14
- "url": "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-2.mp3"
15
- }
16
- ],
17
- "image": "./images/cover.jpg",
18
- "language": "en",
19
- "categories": ["christian-living"],
20
- "description": "A vibrant collection of authentic skate park sounds to energize your projects and playlists.\n\n**Highlights:**\n* Real-world skating ambience\n* Perfect for creative mixes\n* Inspiring background audio for worship gatherings"
21
- }
@@ -1,7 +0,0 @@
1
- {
2
- "label": {
3
- "en": "Guides to Living Your Faith",
4
- "de": "Guides to Living Your Faith"
5
- },
6
- "mediaItems": ["faithful-freestyle--en"]
7
- }
@@ -1,10 +0,0 @@
1
- {
2
- "label": {
3
- "en": "Audio",
4
- "de": "Audio"
5
- },
6
- "detailsPage": {
7
- "layout": "audio"
8
- },
9
- "icon": "lucide--music"
10
- }
@@ -1,15 +0,0 @@
1
- {
2
- "label": {
3
- "en": "Book",
4
- "de": "Buch"
5
- },
6
- "coverImageStyle": "book",
7
- "detailsPage": {
8
- "layout": "default",
9
- "openActionLabel": {
10
- "en": "Read",
11
- "de": "Lesen"
12
- }
13
- },
14
- "icon": "lucide--book-open-text"
15
- }
@@ -1,10 +0,0 @@
1
- {
2
- "label": {
3
- "en": "Video",
4
- "de": "Video"
5
- },
6
- "detailsPage": {
7
- "layout": "video"
8
- },
9
- "icon": "lucide--video"
10
- }
@@ -1,3 +0,0 @@
1
- import { LIGHTNET_COLLECTIONS } from "lightnet/content"
2
-
3
- export const collections = LIGHTNET_COLLECTIONS
@@ -1,15 +0,0 @@
1
- ---
2
- export { getLocalePaths as getStaticPaths } from "lightnet/i18n"
3
-
4
- import { MediaGallerySection, Page } from "lightnet/components"
5
- import { getMediaItems } from "lightnet/content"
6
-
7
- const allItems = await getMediaItems()
8
- ---
9
-
10
- <Page>
11
- <MediaGallerySection
12
- title={Astro.locals.i18n.t("home.all-items")}
13
- items={allItems}
14
- />
15
- </Page>
@@ -1 +0,0 @@
1
- home.all-items: Alle Artikel
@@ -1 +0,0 @@
1
- home.all-items: All items
@@ -1,8 +0,0 @@
1
- import { lightnetStyles } from "lightnet/tailwind.config.ts"
2
-
3
- /**
4
- * @type {import('tailwindcss').Config}
5
- */
6
- export default {
7
- presets: [lightnetStyles({ primaryColor: "#14004B" })],
8
- }
@@ -1,5 +0,0 @@
1
- import { teardownAstroFixtures } from "@internal/e2e-test-utils"
2
-
3
- export default async function globalTeardown() {
4
- await teardownAstroFixtures()
5
- }
@@ -1,123 +0,0 @@
1
- import { expect } from "@playwright/test"
2
-
3
- import { test } from "./basics-fixture"
4
-
5
- test("Should have title set", async ({ page, lightnet }) => {
6
- await lightnet()
7
- await expect(page).toHaveTitle("Basic Test")
8
- })
9
-
10
- test("Should have header title that navigates to home page", async ({
11
- page,
12
- lightnet,
13
- }) => {
14
- const ln = await lightnet()
15
- await page.getByRole("link", { name: "Basic Test" }).click()
16
-
17
- await expect(page).toHaveURL(ln.resolveURL("/en/"))
18
- })
19
-
20
- test("Should have item section", async ({ page, lightnet }) => {
21
- await lightnet()
22
- await expect(page.getByRole("heading", { name: "All items" })).toBeVisible()
23
- })
24
-
25
- test("Should navigate to search page from main menu", async ({
26
- page,
27
- lightnet,
28
- }) => {
29
- const ln = await lightnet()
30
- await expect(
31
- page.getByRole("button", { name: "Open Main Menu" }),
32
- ).toBeVisible()
33
- await page
34
- .getByRole("navigation")
35
- .getByRole("button", { name: "Open Main Menu" })
36
- .click()
37
- await page.getByRole("navigation").getByText("Search").click()
38
-
39
- await expect(page).toHaveURL(ln.resolveURL("/en/media"))
40
- await expect(page.getByRole("heading", { name: "Search" })).toBeVisible()
41
- })
42
-
43
- test("Should switch languages", async ({ page, lightnet }) => {
44
- const ln = await lightnet()
45
-
46
- await page.getByLabel("Select language").click()
47
- await page.getByRole("link", { name: "Deutsch" }).click()
48
- await expect(page).toHaveURL(ln.resolveURL("/de/"))
49
- await expect(page.getByRole("heading")).toHaveText("Alle Artikel")
50
-
51
- await page.getByLabel("Sprache auswählen").click()
52
- await page.getByRole("link", { name: "English" }).click()
53
- await expect(page).toHaveURL(ln.resolveURL("/en/"))
54
- })
55
-
56
- test("Should verify EN Detail media page url and title", async ({
57
- page,
58
- lightnet,
59
- }) => {
60
- const ln = await lightnet()
61
-
62
- await page.getByRole("link", { name: "Faithful Freestyle" }).click()
63
- await expect(
64
- page.getByRole("heading", { name: "Faithful Freestyle" }),
65
- ).toBeVisible()
66
- await expect(page).toHaveURL(
67
- ln.resolveURL("/en/media/faithful-freestyle--en"),
68
- )
69
-
70
- await page.goBack()
71
-
72
- await page.getByRole("link", { name: "Kickflip Anleitung" }).click()
73
- await expect(
74
- page.getByRole("heading", { name: "Kickflip Anleitung" }),
75
- ).toBeVisible()
76
- await expect(page).toHaveURL(ln.resolveURL("/en/media/how-to-kickflip--de"))
77
- })
78
-
79
- test("Should verify DE Detail media page url and title", async ({
80
- page,
81
- lightnet,
82
- }) => {
83
- const ln = await lightnet()
84
-
85
- await page.getByLabel("Select language").click()
86
- await page.getByRole("link", { name: "Deutsch" }).click()
87
- await page.getByRole("link", { name: "Faithful Freestyle" }).click()
88
- await expect(page).toHaveURL(
89
- ln.resolveURL("/de/media/faithful-freestyle--en"),
90
- )
91
-
92
- const lesenLink = page.getByRole("link", { name: "Lesen" })
93
- await expect(lesenLink).toBeVisible()
94
- await expect(lesenLink).toBeEnabled()
95
- // await lesenLink.click()
96
- // await page.waitForLoadState("networkidle")
97
- // await page.goBack()
98
-
99
- await expect(page.getByRole("button", { name: "Teilen" })).toBeVisible()
100
- await expect(page.getByText("Sprache")).toBeVisible()
101
- await expect(page.getByText("Kategorie")).toBeVisible()
102
- })
103
-
104
- test("Should show `Powered by LightNet` in footer", async ({
105
- page,
106
- lightnet,
107
- }) => {
108
- await lightnet()
109
-
110
- const footerLink = page
111
- .getByRole("contentinfo")
112
- .getByRole("link", { name: /LightNet/ })
113
-
114
- await expect(footerLink).toHaveText("Powered by LightNet")
115
- await expect(footerLink).toHaveAttribute("href", "https://lightnet.community")
116
-
117
- await page.getByLabel("Select language").click()
118
- await page.getByRole("link", { name: "Deutsch" }).click()
119
-
120
- await expect(
121
- page.getByRole("contentinfo").getByRole("link", { name: /LightNet/ }),
122
- ).toHaveText("Ermöglicht durch LightNet")
123
- })
@@ -1,14 +0,0 @@
1
- import { expect } from "@playwright/test"
2
-
3
- import { test } from "./basics-fixture"
4
-
5
- test("Search should have heading section and URL", async ({
6
- page,
7
- lightnet,
8
- }) => {
9
- const ln = await lightnet()
10
-
11
- await page.getByLabel("Search").click()
12
- await expect(page.getByRole("heading", { name: "Search" })).toBeVisible()
13
- await expect(page).toHaveURL(ln.resolveURL("/en/media"))
14
- })