From 965c610b495baf412fe4f1dc8d3a0a17963d8242 Mon Sep 17 00:00:00 2001 From: Robin Fernandes Date: Fri, 21 Jul 2023 14:16:40 +1000 Subject: [PATCH] Fix name of enableScope/disableScope in README and test description. --- README.md | 2 +- tests/HotkeysProvider.test.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fbcd469b..dba8587f 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ export const ExampleComponent = () => { #### Changing a scope's active state -You can change the active state of a scope using the `deactivateScope`, `activateScope` and `toggleScope` functions +You can change the active state of a scope using the `disableScope`, `enableScope` and `toggleScope` functions returned by the `useHotkeysContext()` hook. Note that you have to have your app wrapped in a `` component. ```jsx harmony diff --git a/tests/HotkeysProvider.test.tsx b/tests/HotkeysProvider.test.tsx index 293e2e53..2156fff6 100644 --- a/tests/HotkeysProvider.test.tsx +++ b/tests/HotkeysProvider.test.tsx @@ -43,7 +43,7 @@ test('should return active scopes and scope modifying functions', () => { expect(result.current.toggleScope).toBeInstanceOf(Function) }) -test('should activate scope by calling activateScope', () => { +test('should activate scope by calling enableScope', () => { const { result } = renderHook(() => useHotkeysContext(), { wrapper: HotkeysProvider, }) @@ -91,7 +91,7 @@ test('should return multiple scopes if different scopes are activated', () => { expect(result.current.enabledScopes).toEqual(['foo', 'bar']) }) -test('should deactivate scope by calling deactivateScope', () => { +test('should deactivate scope by calling disableScope', () => { const { result } = renderHook(() => useHotkeysContext(), { wrapper: HotkeysProvider, })