-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Render decision tree based on url (#125)
* rename OffCanvas prop from 'handleClose' to 'onClose' * add path URL parameter as parameter to to useDecisionTree * build path (and store in global state) from URL query parameter * auto build tree when URL query parameter is present * remove duplicate function * add error handling for showHelp function returned from useHelp hook
- Loading branch information
1 parent
ebb2d9b
commit 662f06e
Showing
12 changed files
with
141 additions
and
109 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 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
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 |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import '@testing-library/jest-dom'; | ||
import { renderHook } from '@testing-library/react'; | ||
import { useHelp } from 'hooks/useHelp/useHelp'; | ||
import { expect, suite, test } from 'vitest'; | ||
import { describe, expect, test } from 'vitest'; | ||
|
||
suite('useHelp hook', () => { | ||
describe('useHelp hook', () => { | ||
test('helpIsOpen is initially false', () => { | ||
const { result } = renderHook(() => useHelp()); | ||
expect(result.current.helpIsOpen).toBe(false); | ||
}); | ||
test('showHelp returns if arg is undefined', () => { | ||
const { result } = renderHook(() => useHelp()); | ||
expect(() => result.current.showHelp(undefined)).toThrowError('contentId is required'); | ||
}); | ||
}); |
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
Oops, something went wrong.