Skip to content

Commit cc69d14

Browse files
committed
Merge branch 'main' into feat/codegen-discussions
Signed-off-by: Adam Setch <[email protected]>
2 parents fec2a79 + df35341 commit cc69d14

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ pnpm install
1818
> OAUTH_CLIENT_ID="123" OAUTH_CLIENT_SECRET="456789" pnpm build
1919
> ```
2020
21+
Copy the `.env.template` to `.env` and add update `GITHUB_TOKEN` with a GitHub Personal Access Token. This is used for fetching the latest GitHub GraphQL API schema for `graphql-codegen`.
22+
```shell
23+
GITHUB_TOKEN=<some personal access token>
24+
```
25+
2126
To watch for changes (`webpack`) in the `src` directory:
2227

2328
```shell

jest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { Config } from 'jest';
22

33
const config: Config = {
44
preset: 'ts-jest',
5+
globalSetup: '<rootDir>/src/renderer/__helpers__/jest.setup.env.ts',
56
setupFilesAfterEnv: ['<rootDir>/src/renderer/__helpers__/jest.setup.ts'],
67
testEnvironment: 'jsdom',
78
collectCoverage: true,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Jest Global Setup
3+
* This runs once before all test suites
4+
*/
5+
export default () => {
6+
// Sets timezone to UTC for consistent date/time in tests and snapshots
7+
process.env.TZ = 'UTC';
8+
9+
// Mock OAuth client ID and secret
10+
process.env.OAUTH_CLIENT_ID = 'FAKE_CLIENT_ID_123';
11+
process.env.OAUTH_CLIENT_SECRET = 'FAKE_CLIENT_SECRET_123';
12+
};

src/renderer/__helpers__/jest.setup.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ window.gitify = {
4545
raiseNativeNotification: jest.fn(),
4646
};
4747

48-
// Mock OAuth client ID and secret
49-
process.env.OAUTH_CLIENT_ID = 'FAKE_CLIENT_ID_123';
50-
process.env.OAUTH_CLIENT_SECRET = 'FAKE_CLIENT_SECRET_123';
51-
5248
globalThis.HTMLMediaElement.prototype.play = jest.fn();
5349

5450
globalThis.matchMedia = (query: string): MediaQueryList => ({

src/renderer/utils/notifications/handlers/issue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class IssueHandler extends DefaultHandler {
5353

5454
return {
5555
number: issue.number,
56-
state: issue.state_reason ?? issue.state,
56+
state: issueState,
5757
user: getSubjectUser([issueCommentUser, issue.user]),
5858
comments: issue.comments,
5959
labels: issue.labels?.map((label) => label.name) ?? [],

0 commit comments

Comments
 (0)