Skip to content

Commit eca0294

Browse files
committed
test: add new tests for changes
1 parent 70df9d0 commit eca0294

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

test/module.spec.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
const { expect } = require('chai')
2-
const { askForFoldersAccess, getAuthStatus, askForScreenCaptureAccess } = require('../index')
2+
const {
3+
askForFoldersAccess,
4+
getAuthStatus,
5+
askForPhotosAccess,
6+
askForScreenCaptureAccess,
7+
askForInputMonitoringAccess,
8+
} = require('../index')
39

410
describe('node-mac-permissions', () => {
511
describe('getAuthStatus()', () => {
@@ -44,6 +50,22 @@ describe('node-mac-permissions', () => {
4450
})
4551
})
4652

53+
describe('askForInputMonitoringAccess()', () => {
54+
it('should throw on invalid types', () => {
55+
expect(() => {
56+
askForInputMonitoringAccess('bad-type')
57+
}).to.throw(/bad-type must be one of either 'listen' or 'post'/)
58+
})
59+
})
60+
61+
describe('askForPhotosAccess()', () => {
62+
it('should throw on invalid types', () => {
63+
expect(() => {
64+
askForPhotosAccess('bad-type')
65+
}).to.throw(/bad-type must be one of either 'add-only' or 'read-write'/)
66+
})
67+
})
68+
4769
describe('askForScreenCaptureAccess()', () => {
4870
it('should throw on invalid openPreferences type', () => {
4971
expect(() => {

0 commit comments

Comments
 (0)