We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9bf4e91 commit 23b2360Copy full SHA for 23b2360
src/index.test.js
@@ -12,11 +12,21 @@ describe('SilentHack', () => {
12
expect(silentHack).toBeInstanceOf(SilentHack);
13
});
14
15
- it('should have a state of blocked', () => {
16
- expect(silentHack.state).toBe('blocked');
+ it('should be not allowed', () => {
+ expect(silentHack.allowed).toBe(false);
17
18
19
it('should have a trying property of false', () => {
20
expect(silentHack.trying).toBe(false);
21
22
+
23
+ it('should call tryUnblock on event', async () => {
24
+ const event = new Event('click');
25
+ window.dispatchEvent(event);
26
+ expect(silentHack.trying).toBe(true);
27
28
+ await new Promise((resolve) => setTimeout(resolve, 100));
29
30
+ expect(silentHack.allowed).toBe(true);
31
+ });
32
0 commit comments