File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11const { 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
410describe ( '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 ( / b a d - t y p e m u s t b e o n e o f e i t h e r ' l i s t e n ' o r ' p o s t ' / )
58+ } )
59+ } )
60+
61+ describe ( 'askForPhotosAccess()' , ( ) => {
62+ it ( 'should throw on invalid types' , ( ) => {
63+ expect ( ( ) => {
64+ askForPhotosAccess ( 'bad-type' )
65+ } ) . to . throw ( / b a d - t y p e m u s t b e o n e o f e i t h e r ' a d d - o n l y ' o r ' r e a d - w r i t e ' / )
66+ } )
67+ } )
68+
4769 describe ( 'askForScreenCaptureAccess()' , ( ) => {
4870 it ( 'should throw on invalid openPreferences type' , ( ) => {
4971 expect ( ( ) => {
You can’t perform that action at this time.
0 commit comments