Skip to content

Commit

Permalink
Merge branch 'alpha' into feat/unit-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPietrusky authored Feb 21, 2024
2 parents 173d698 + 382b8ce commit e4c9057
Show file tree
Hide file tree
Showing 27 changed files with 207 additions and 3,850 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/set-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Set PR Title to First Commit Message

on:
pull_request:
types: [opened, synchronize]

jobs:
set-pr-title:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
# Fetches the entire commit history so that we can access the first commit
fetch-depth: 0

- name: Get first commit message
run: |
# Get the SHA of the first commit in the PR
FIRST_COMMIT_SHA=$(git log --reverse --format="%H" "${{ github.event.pull_request.base.sha }}..HEAD" | head -n 1)
# Get the message of the first commit in the PR
FIRST_COMMIT_MESSAGE=$(git log -n 1 --format=%B "$FIRST_COMMIT_SHA")
echo "FIRST_COMMIT_MESSAGE=$FIRST_COMMIT_MESSAGE" >> $GITHUB_ENV
- name: Update PR title
run: gh pr edit "$PR_NUMBER" --title "$FIRST_COMMIT_MESSAGE"
env:
FIRST_COMMIT_MESSAGE: ${{ env.FIRST_COMMIT_MESSAGE }}
GITHUB_TOKEN: ${{ secrets.PIXELASS_PAT_BLIBLA }}
PR_NUMBER: ${{ github.event.pull_request.number }}
60 changes: 60 additions & 0 deletions package-lock.json

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

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"build": "nextron build",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
"dev": "nextron",
"eslint": "eslint \"{renderer,main}/{**/*,*}{.,.config.,.test.,.e2e.}{js,mjs,ts,tsx}\"",
"eslint": "eslint \"src/{**/*,*}.{ts,tsx}\"",
"postinstall": "electron-builder install-app-deps",
"ncu": "npx npm-check-updates@latest -u",
"ncu:check": "npx npm-check-updates@latest",
Expand All @@ -21,7 +21,9 @@
"toc": "npx markdown-toc README.md -i",
"tsc:noEmit": "tsc --noEmit",
"caption:test": "ts-node-esm main/captions/misc.ts",
"test:unit": "jest --runInBand --config jest.config.ts --verbose"
"test:unit": "jest --runInBand --config jest.config.ts --verbose",
"pretest:e2e": "nextron build --no-pack",
"test:e2e": "npx playwright test"
},
"dependencies": {
"electron-context-menu": "3.6.1",
Expand All @@ -43,6 +45,7 @@
"@mui/joy": "5.0.0-beta.24",
"@mui/material": "5.15.6",
"@next/mdx": "14.1.0",
"@playwright/test": "^1.41.2",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
Expand Down
69 changes: 69 additions & 0 deletions playwright-report/index.html

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { PlaywrightTestConfig } from "@playwright/test";

/**
* See https://playwright.dev/docs/test-configuration.
*/
const config: PlaywrightTestConfig = {
testDir: "./playwright",
};

export default config;
33 changes: 33 additions & 0 deletions playwright/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import type { ElectronApplication, Page } from "@playwright/test";
import { test, expect } from "@playwright/test";
import { _electron as electron } from "playwright";

let electronApp: ElectronApplication;
let page: Page;

test.beforeAll(async () => {
// Use package.main
electronApp = await electron.launch({ args: ["."] });
const isPackaged = await electronApp.evaluate(async ({ app }) => app.isPackaged);

expect(isPackaged).toBe(false);
});

test.afterAll(async () => {
await electronApp.close();
});

test("Renders the first page", async () => {
page = await electronApp.firstWindow();
const title = await page.title();
expect(title).toBe("Blibla");
});

test("Allows switching the language", async () => {
page = await electronApp.firstWindow();

await expect(page.getByTestId("language-selector-list")).toBeVisible();
await expect(page.getByText("Deutsch")).toBeVisible();
await page.getByText("Deutsch").click();
await expect(page.getByText("Sprache")).toBeVisible();
});
68 changes: 0 additions & 68 deletions src/client/organisms/delete-confirm/index.tsx

This file was deleted.

52 changes: 0 additions & 52 deletions src/client/organisms/folder-drop/index.tsx

This file was deleted.

55 changes: 0 additions & 55 deletions src/client/organisms/folder-field/index.tsx

This file was deleted.

Loading

0 comments on commit e4c9057

Please sign in to comment.