Skip to content

Commit 999733e

Browse files
committed
Improve readme; make ant-d 4 updates and fix broken test w/ global setup
1 parent 324eccf commit 999733e

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

{{ cookiecutter.project_slug }}/README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,11 @@ Open localhost:8080 in your browser.
3131

3232
## Development Host Side Notes
3333

34-
If you want things like linting and typechecking to work on the host side,
35-
feel free to run `npm install` from host (in `server/` or `client/`) directory
36-
on the host. It will generate node_modules, presumably identical to inside the
37-
server container, and won't overwrite those through skaffold nor docker
38-
compose.
34+
Running `docker-compose up -d` starts the client in watch mode, so updates you make will not require building assets manually.
3935

40-
Additionally, when developing for the client, you'll want to run
41-
`npm run generate` or `npm run generate:watch` on the host from the `client`
42-
directory to ensure that you can see the generated graphql-codegen files (which
43-
are excluded from syncing to host via use of a named volume).
36+
When developing for the client, you'll want to run `npm run generate` or `npm run generate:watch` on the host from the `client` directory to ensure that you can see the generated graphql-codegen files (which are excluded from syncing to host via use of a named volume).
4437

38+
Additionally, if you want things like linting and typechecking to work on the host side, feel free to run `npm install` from host (in `server/` or `client/`) directory on the host. It will generate node_modules, presumably identical to inside the server container, and won't overwrite those through skaffold nor docker compose.
4539

4640
## Running Tests
4741
For tests, you'll want to use docker compose to build and run the test docker-compose

{{ cookiecutter.project_slug }}/client/src/__tests__/jestSetup.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,18 @@ global._env_ = {
44
API_GRAPHQL_SERVER_URL: 'http://localhost:8000',
55
API_CSRFTOKEN_URL: 'http://localhost:8000',
66
};
7+
8+
// See https://github.com/ant-design/ant-design/issues/21096
9+
Object.defineProperty(window, 'matchMedia', {
10+
writable: true,
11+
value: jest.fn().mockImplementation(query => ({
12+
matches: false,
13+
media: query,
14+
onchange: null,
15+
addListener: jest.fn(),
16+
removeListener: jest.fn(),
17+
addEventListener: jest.fn(),
18+
removeEventListener: jest.fn(),
19+
dispatchEvent: jest.fn(),
20+
})),
21+
});

{{ cookiecutter.project_slug }}/client/src/components/Login.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const Login: React.FC<LoginProps> = ({ navigate }) => {
4040
<Form
4141
labelCol={itemLayout.labelCol}
4242
wrapperCol={itemLayout.wrapperCol}
43-
onSubmit={e => {
43+
onFinish={e => {
4444
e.preventDefault();
4545
tokenAuth();
4646
}}

0 commit comments

Comments
 (0)