Skip to content

Commit

Permalink
Merge Release 2.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sharunkumar committed Apr 6, 2024
2 parents 5fdad66 + 77055bf commit b96763c
Show file tree
Hide file tree
Showing 26 changed files with 1,085 additions and 1,120 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
** @aeharding
/e2e/ @aashu16 @aeharding
27 changes: 27 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Run e2e tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
playwright:
name: Run Playwright tests
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.43.0-jammy
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build project
run: pnpm build
- name: Run tests
run: env HOME=/root pnpm test:e2e
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ vite.config.ts.timestamp-*

# fly.io
fly.toml
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "app.vger.voyager"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 236
versionName "2.3.0"
versionCode 237
versionName "2.3.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
30 changes: 30 additions & 0 deletions e2e/community-feed.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { test, expect } from "@playwright/test";

import { posts } from "./testdata/posts";

test("load community posts", async ({ page }) => {
await page.route("*/**/api/v3/post/list**", async (route) => {
await route.fulfill({ json: { posts } });
});

await page.goto("/");
await page.waitForURL("/posts/lemmy.world/all");

await expect(page).toHaveTitle("Voyager for Lemmy");

await expect(page.getByText(posts[0].post.name)).toBeVisible();
});

test("navigate to post on click", async ({ page }) => {
await page.route("*/**/api/v3/post/list**", async (route) => {
await route.fulfill({ json: { posts } });
});

await page.goto("/");

await page.getByText(posts[0].post.name).click();

await expect(page).toHaveURL(
"/posts/lemmy.world/c/community_1@test.lemmy/comments/999",
);
});
75 changes: 75 additions & 0 deletions e2e/testdata/posts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import type { PostView } from "lemmy-js-client";

export const posts: PostView[] = [
{
post: {
id: 999,
name: "Post 999 title",
body: "Post 999 body.",
creator_id: 100,
community_id: 111,
removed: false,
locked: false,
published: "2024-04-01T00:00:00.000000Z",
updated: "2024-04-01T00:00:00.000000Z",
deleted: false,
nsfw: false,
thumbnail_url: "",
ap_id: "",
local: false,
language_id: 0,
featured_community: false,
featured_local: false,
},
creator: {
id: 100,
name: "user_1",
display_name: "lemmy_user",
banned: false,
published: "2024-04-01T00:00:00.000000Z",
actor_id: "https://test.lemmy/u/lemmy_user",
local: false,
deleted: false,
bot_account: false,
instance_id: 1,
},
community: {
id: 111,
name: "community_1",
title: "Community",
description: "Description 1",
removed: false,
published: "2024-04-01T00:00:00.000000Z",
updated: "2024-04-01T00:00:00.000000Z",
deleted: false,
nsfw: false,
actor_id: "https://test.lemmy/c/community_1",
local: false,
icon: "",
banner: "",
hidden: false,
posting_restricted_to_mods: false,
instance_id: 3,
visibility: "Public",
},
creator_banned_from_community: false,
creator_is_moderator: false,
creator_is_admin: false,
counts: {
post_id: 111,
comments: 20,
score: 91,
upvotes: 100,
downvotes: 9,
published: "2024-04-01T00:00:00.000000Z",
newest_comment_time: "2024-04-01T00:00:00.000000Z",
},
subscribed: "NotSubscribed",
saved: false,
read: false,
creator_blocked: false,
unread_comments: 20,
banned_from_community: false,
hidden: false,
},
];
4 changes: 2 additions & 2 deletions ios/App/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.3.0</string>
<string>2.3.1</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand All @@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>236</string>
<string>237</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>
Expand Down
98 changes: 51 additions & 47 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
"name": "voyager",
"description": "A progressive webapp Lemmy client",
"private": true,
"version": "2.3.0",
"version": "2.3.1",
"type": "module",
"packageManager": "pnpm@8.15.5+sha256.4b4efa12490e5055d59b9b9fc9438b7d581a6b7af3b5675eb5c5f447cee1a589",
"packageManager": "pnpm@8.15.6+sha256.01c01eeb990e379b31ef19c03e9d06a14afa5250b82e81303f88721c99ff2e6f",
"scripts": {
"dev": "vite",
"build": "./build.sh",
"preview": "vite preview",
"test": "vitest",
"test:e2e": "playwright test",
"test:typecheck": "tsc",
"lint": "eslint src --max-warnings=0",
"lint:formatting": "prettier --check .",
Expand All @@ -28,15 +29,12 @@
"@capacitor/browser@5.2.0": "patches/@capacitor__browser@5.2.0.patch"
}
},
"dependencies": {},
"devDependencies": {
"dependencies": {
"@aeharding/remark-lemmy-spoiler": "^1.0.1",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@capacitor-community/app-icon": "^4.1.1",
"@capacitor/android": "5.7.4",
"@capacitor/app": "^5.0.7",
"@capacitor/assets": "^3.0.4",
"@capacitor/assets": "^3.0.5",
"@capacitor/browser": "^5.2.0",
"@capacitor/cli": "5.7.4",
"@capacitor/core": "5.7.4",
Expand All @@ -53,27 +51,7 @@
"@ionic/react-router": "8.0.0-rc.0",
"@linaria/core": "^6.1.0",
"@linaria/react": "^6.1.0",
"@reduxjs/toolkit": "^2.2.2",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@testing-library/user-event": "^14.5.2",
"@trapezedev/configure": "^7.0.10",
"@types/history": "^4.7.11",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.14.202",
"@types/mdast": "^4.0.3",
"@types/react": "^18.2.58",
"@types/react-dom": "^18.2.19",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@types/ua-parser-js": "^0.7.39",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"@vitejs/plugin-legacy": "^5.3.1",
"@vitejs/plugin-react": "^4.2.1",
"@wyw-in-js/babel-preset": "^0.5.0",
"@wyw-in-js/vite": "^0.5.0",
"@reduxjs/toolkit": "^2.2.3",
"capacitor-android-nav-mode": "^0.0.1",
"capacitor-application-context": "^0.0.1",
"capacitor-biometric-lock": "^0.1.1",
Expand All @@ -85,17 +63,11 @@
"capacitor-tips": "^0.0.2",
"compare-versions": "^6.1.0",
"date-fns": "^3.3.1",
"dexie": "^3.2.7",
"dexie": "^4.0.1",
"dexie-react-hooks": "^1.1.7",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"history": "^4.10.1",
"ionicons": "^7.3.0",
"jsdom": "^24.0.0",
"lemmy-js-client": "0.19.4-alpha.13",
"ionicons": "^7.3.1",
"lemmy-js-client": "0.19.4-alpha.16",
"lodash": "^4.17.21",
"mdast-util-gfm-autolink-literal-lemmy": "^3.0.0",
"mdast-util-gfm-strikethrough": "^2.0.0",
Expand All @@ -107,8 +79,6 @@
"micromark-util-combine-extensions": "^2.0.0",
"modern-screenshot": "^4.4.38",
"photoswipe": "^5.4.3",
"prettier": "^3.2.5",
"pwa-asset-generator": "^6.3.1",
"react": "^18.2.0",
"react-animate-height": "^3.2.3",
"react-dom": "^18.2.0",
Expand All @@ -125,24 +95,58 @@
"rehype-highlight": "^7.0.0",
"rehype-parse": "^9.0.0",
"rehype-remark": "^10.0.0",
"release-it": "^17.1.1",
"remark-gfm": "^4.0.0",
"remark-parse": "^11.0.0",
"remark-stringify": "^11.0.0",
"remark-supersub-lemmy": "^1.0.0",
"terser": "^5.28.1",
"typescript": "^5.4.3",
"ua-parser-js": "^1.0.37",
"unified": "^11.0.4",
"unist-util-visit": "^5.0.0",
"use-long-press": "^3.2.0",
"usehooks-ts": "^3.0.1",
"usehooks-ts": "^3.0.2",
"uuid": "^9.0.1",
"virtua": "^0.29.1",
"vite": "^5.2.2",
"vite-plugin-pwa": "^0.19.6",
"vite-plugin-svgr": "^4.2.0",
"vitest": "^1.3.1",
"workbox-window": "^7.0.0"
},
"devDependencies": {
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@playwright/test": "^1.43.0",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@testing-library/user-event": "^14.5.2",
"@trapezedev/configure": "^7.0.10",
"@types/history": "^4.0.0",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.14.202",
"@types/mdast": "^4.0.3",
"@types/node": "^20.12.4",
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.23",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@types/ua-parser-js": "^0.7.39",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"@vitejs/plugin-legacy": "^5.3.1",
"@vitejs/plugin-react": "^4.2.1",
"@wyw-in-js/babel-preset": "^0.5.0",
"@wyw-in-js/vite": "^0.5.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"jsdom": "^24.0.0",
"prettier": "^3.2.5",
"pwa-asset-generator": "^6.3.1",
"release-it": "^17.1.1",
"terser": "^5.30.2",
"typescript": "^5.4.3",
"vite": "^5.2.7",
"vite-plugin-pwa": "^0.19.7",
"vite-plugin-svgr": "^4.2.0",
"vitest": "^1.3.1"
}
}
46 changes: 46 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { defineConfig, devices } from "@playwright/test";

const serverURL = "http://localhost:" + (process.env.CI ? "4173" : "5173");

export default defineConfig({
testDir: "./e2e",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: "list",
use: {
baseURL: serverURL,

trace: "on-first-retry",
},

projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
{
name: "firefox",
use: { ...devices["Desktop Firefox"] },
},
{
name: "webkit",
use: { ...devices["Desktop Safari"] },
},
{
name: "Mobile Chrome",
use: { ...devices["Pixel 7"] },
},
{
name: "Mobile Safari",
use: { ...devices["iPhone 14"] },
},
],

webServer: {
command: process.env.CI ? "pnpm preview" : "pnpm dev",
url: serverURL,
reuseExistingServer: !process.env.CI,
},
});
Loading

0 comments on commit b96763c

Please sign in to comment.