forked from laurent22/joplin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pr/mobile/accessibility/fix-touch-delay'
- Loading branch information
Showing
67 changed files
with
3,500 additions
and
2,163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,15 +72,15 @@ | |
"@crowdin/cli": "3", | ||
"@joplin/utils": "~2.12", | ||
"@seiyab/eslint-plugin-react-hooks": "4.5.1-beta.0", | ||
"@typescript-eslint/eslint-plugin": "6.8.0", | ||
"@typescript-eslint/parser": "6.8.0", | ||
"@typescript-eslint/eslint-plugin": "6.21.0", | ||
"@typescript-eslint/parser": "6.21.0", | ||
"cspell": "5.21.2", | ||
"eslint": "8.52.0", | ||
"eslint": "8.57.0", | ||
"eslint-interactive": "10.8.0", | ||
"eslint-plugin-import": "2.28.1", | ||
"eslint-plugin-jest": "27.4.3", | ||
"eslint-plugin-promise": "6.1.1", | ||
"eslint-plugin-react": "7.33.2", | ||
"eslint-plugin-import": "2.29.1", | ||
"eslint-plugin-jest": "27.9.0", | ||
"eslint-plugin-promise": "6.2.0", | ||
"eslint-plugin-react": "7.34.3", | ||
"execa": "5.1.1", | ||
"fs-extra": "11.2.0", | ||
"glob": "10.4.2", | ||
|
@@ -90,20 +90,20 @@ | |
"lint-staged": "15.2.7", | ||
"madge": "6.1.0", | ||
"npm-package-json-lint": "7.1.0", | ||
"typescript": "5.2.2" | ||
"typescript": "5.4.5" | ||
}, | ||
"dependencies": { | ||
"@types/fs-extra": "11.0.4", | ||
"eslint-plugin-github": "4.10.1", | ||
"eslint-plugin-github": "4.10.2", | ||
"http-server": "14.1.1", | ||
"node-gyp": "9.4.1", | ||
"nodemon": "3.0.3" | ||
"nodemon": "3.1.7" | ||
}, | ||
"packageManager": "yarn@3.6.4", | ||
"packageManager": "yarn@3.8.3", | ||
"resolutions": { | ||
"[email protected]": "patch:react-native-camera@npm%3A4.2.1#./.yarn/patches/react-native-camera-npm-4.2.1-24b2600a7e.patch", | ||
"[email protected]": "patch:react-native-vosk@npm%3A0.1.12#./.yarn/patches/react-native-vosk-npm-0.1.12-76b1caaae8.patch", | ||
"eslint": "patch:eslint@8.52.0#./.yarn/patches/eslint-npm-8.39.0-d92bace04d.patch", | ||
"eslint": "patch:eslint@8.57.0#./.yarn/patches/eslint-npm-8.39.0-d92bace04d.patch", | ||
"[email protected]": "patch:app-builder-lib@npm%3A24.4.0#./.yarn/patches/app-builder-lib-npm-24.4.0-05322ff057.patch", | ||
"nanoid": "patch:nanoid@npm%3A3.3.7#./.yarn/patches/nanoid-npm-3.3.7-98824ba130.patch", | ||
"pdfjs-dist": "patch:pdfjs-dist@npm%3A3.11.174#./.yarn/patches/pdfjs-dist-npm-3.11.174-67f2fee6d6.patch", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
packages/app-desktop/gui/NoteListItem/utils/useRootElement.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { act, renderHook } from '@testing-library/react-hooks'; | ||
import useRootElement from './useRootElement'; | ||
|
||
describe('useRootElement', () => { | ||
beforeEach(() => { | ||
jest.useFakeTimers({ advanceTimers: true }); | ||
}); | ||
|
||
test('should find an element with a matching ID', async () => { | ||
const testElement = document.createElement('div'); | ||
testElement.id = 'test-element-id'; | ||
document.body.appendChild(testElement); | ||
|
||
const { result } = renderHook(useRootElement, { | ||
initialProps: testElement.id, | ||
}); | ||
await act(async () => { | ||
await jest.advanceTimersByTimeAsync(100); | ||
}); | ||
expect(result.current).toBe(testElement); | ||
|
||
testElement.remove(); | ||
}); | ||
|
||
test('should redo the element search when the elementId prop changes', async () => { | ||
const testElement = document.createElement('div'); | ||
document.body.appendChild(testElement); | ||
|
||
const { rerender, result } = renderHook(useRootElement, { | ||
initialProps: 'some-id-here', | ||
}); | ||
await jest.advanceTimersByTimeAsync(100); | ||
expect(result.current).toBe(null); | ||
|
||
// Searching for another non-existent ID: Should not match | ||
rerender('updated-id'); | ||
await jest.advanceTimersByTimeAsync(100); | ||
expect(result.current).toBe(null); | ||
|
||
// Should not match the first element if its ID is set to the original (search | ||
// should be cancelled). | ||
testElement.id = 'some-id-here'; | ||
await jest.advanceTimersByTimeAsync(100); | ||
expect(result.current).toBe(null); | ||
|
||
// Should match if the element ID changes to the updated ID. | ||
await act(async () => { | ||
testElement.id = 'updated-id'; | ||
await jest.advanceTimersByTimeAsync(100); | ||
}); | ||
expect(result.current).toBe(testElement); | ||
|
||
testElement.remove(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.