mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-01 19:58:15 +08:00
Merge remote-tracking branch 'origin/next' into develop
Some checks failed
Build docker image / build-and-push (push) Has been cancelled
Build pro image / build-and-push (push) Has been cancelled
E2E / Build (push) Has been cancelled
E2E / Core and plugins (push) Has been cancelled
E2E / plugin-workflow (push) Has been cancelled
E2E / plugin-workflow-approval (push) Has been cancelled
E2E / plugin-data-source-main (push) Has been cancelled
E2E / Comment on PR (push) Has been cancelled
Some checks failed
Build docker image / build-and-push (push) Has been cancelled
Build pro image / build-and-push (push) Has been cancelled
E2E / Build (push) Has been cancelled
E2E / Core and plugins (push) Has been cancelled
E2E / plugin-workflow (push) Has been cancelled
E2E / plugin-workflow-approval (push) Has been cancelled
E2E / plugin-data-source-main (push) Has been cancelled
E2E / Comment on PR (push) Has been cancelled
This commit is contained in:
commit
9521aee152
4
.github/workflows/nocobase-test-frontend.yml
vendored
4
.github/workflows/nocobase-test-frontend.yml
vendored
@ -33,14 +33,14 @@ jobs:
|
||||
frontend-test:
|
||||
strategy:
|
||||
matrix:
|
||||
node_version: ['18']
|
||||
node_version: ['20']
|
||||
runs-on: ubuntu-latest
|
||||
container: node:${{ matrix.node_version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Use Node.js ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
cache: 'yarn'
|
||||
|
3
packages/core/cache/src/cache-manager.ts
vendored
3
packages/core/cache/src/cache-manager.ts
vendored
@ -60,6 +60,9 @@ export class CacheManager {
|
||||
redis: {
|
||||
store: redisStore,
|
||||
close: async (redis: RedisStore) => {
|
||||
if (!redis.client?.isOpen) {
|
||||
return;
|
||||
}
|
||||
await redis.client.quit();
|
||||
},
|
||||
},
|
||||
|
@ -12,6 +12,7 @@ import React from 'react';
|
||||
import App1 from '../demos/input';
|
||||
import App2 from '../demos/textarea';
|
||||
import App3 from '../demos/url';
|
||||
import App4 from '../demos/json';
|
||||
import JSON5 from 'json5';
|
||||
import JSONInput from '../demos/new-demos/json';
|
||||
import JSON5Input from '../demos/new-demos/json5';
|
||||
@ -131,18 +132,13 @@ describe('Input.JSON', () => {
|
||||
});
|
||||
|
||||
it('should display the error when the value is invalid', async () => {
|
||||
const { container } = render(<JSONInput />);
|
||||
const { container } = render(<App4 />);
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText('Test').innerHTML).toBe('Test');
|
||||
const textarea = container.querySelector('textarea') as HTMLTextAreaElement;
|
||||
fireEvent.change(textarea, { target: { value: '{"name":nocobase}' } });
|
||||
fireEvent.blur(textarea, { target: { value: '{"name":nocobase}' } });
|
||||
expect(screen.getByText(/Unexpected token/)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
const textarea = container.querySelector('textarea') as HTMLTextAreaElement;
|
||||
await userEvent.clear(textarea);
|
||||
// To escape special characters, use double curly braces
|
||||
await userEvent.type(textarea, '{{name:"nocobase"}');
|
||||
// mock blur event
|
||||
await userEvent.click(document.body);
|
||||
expect(screen.getByText(/Unexpected token n/)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should not display error when the value is valid JSON5', async () => {
|
||||
|
Loading…
Reference in New Issue
Block a user