function testTeamDriveDirectoryEntry(callback) {
  driveFileSystem.entries['/team_drives/ABC Team/Folder 1'] =
      new MockDirectoryEntry(
          driveFileSystem, '/team_drives/ABC Team/Folder 1', {});

  var model = new ActionsModel(
      volumeManager, metadataModel, shortcutsModel, driveSyncHandler, ui,
      [driveFileSystem.entries['/team_drives/ABC Team/Folder 1']]);
  return reportPromise(
      model.initialize().then(function() {
        var actions = model.getActions();
        assertEquals(3, Object.keys(actions).length);

        // "Share" is enabled for Team Drive directories.
        var shareAction = actions[ActionsModel.CommonActionId.SHARE];
        assertTrue(!!shareAction);
        assertTrue(shareAction.canExecute());

        // "Manage in drive" is enabled for Team Drive directories.
        var manageAction =
            actions[ActionsModel.InternalActionId.MANAGE_IN_DRIVE];
        assertTrue(!!manageAction);
        assertTrue(manageAction.canExecute());

        // 'Create shortcut' should be enabled.
        var createFolderShortcutAction =
            actions[ActionsModel.InternalActionId.CREATE_FOLDER_SHORTCUT];
        assertTrue(!!createFolderShortcutAction);
        assertTrue(createFolderShortcutAction.canExecute());
      }),
      callback);
}
/**
 * Tests that a Team Drive directory entry has the correct actions available.
 */
Tests that a Team Drive directory entry has the correct actions available.
Tests that a Team Drive directory entry has the correct actions available .
function testTeamDriveDirectoryEntry(callback) {
  driveFileSystem.entries['/team_drives/ABC Team/Folder 1'] =
      new MockDirectoryEntry(
          driveFileSystem, '/team_drives/ABC Team/Folder 1', {});
  var model = new ActionsModel(
      volumeManager, metadataModel, shortcutsModel, driveSyncHandler, ui,
      [driveFileSystem.entries['/team_drives/ABC Team/Folder 1']]);
  return reportPromise(
      model.initialize().then(function() {
        var actions = model.getActions();
        assertEquals(3, Object.keys(actions).length);
        var shareAction = actions[ActionsModel.CommonActionId.SHARE];
        assertTrue(!!shareAction);
        assertTrue(shareAction.canExecute());
        var manageAction =
            actions[ActionsModel.InternalActionId.MANAGE_IN_DRIVE];
        assertTrue(!!manageAction);
        assertTrue(manageAction.canExecute());
        var createFolderShortcutAction =
            actions[ActionsModel.InternalActionId.CREATE_FOLDER_SHORTCUT];
        assertTrue(!!createFolderShortcutAction);
        assertTrue(createFolderShortcutAction.canExecute());
      }),
      callback);
}
function testTeamDriveDirectoryEntry ( callback ) { driveFileSystem . entries [ '/team_drives/ABC Team/Folder 1' ] = new MockDirectoryEntry ( driveFileSystem , '/team_drives/ABC Team/Folder 1' , { } ) ; var model = new ActionsModel ( volumeManager , metadataModel , shortcutsModel , driveSyncHandler , ui , [ driveFileSystem . entries [ '/team_drives/ABC Team/Folder 1' ] ] ) ; return reportPromise ( model . initialize ( ) . then ( function ( ) { var actions = model . getActions ( ) ; assertEquals ( 3 , Object . keys ( actions ) . length ) ; var shareAction = actions [ ActionsModel . CommonActionId . SHARE ] ; assertTrue ( ! ! shareAction ) ; assertTrue ( shareAction . canExecute ( ) ) ; var manageAction = actions [ ActionsModel . InternalActionId . MANAGE_IN_DRIVE ] ; assertTrue ( ! ! manageAction ) ; assertTrue ( manageAction . canExecute ( ) ) ; var createFolderShortcutAction = actions [ ActionsModel . InternalActionId . CREATE_FOLDER_SHORTCUT ] ; assertTrue ( ! ! createFolderShortcutAction ) ; assertTrue ( createFolderShortcutAction . canExecute ( ) ) ; } ) , callback ) ; }
Tests that a Team Drive directory entry has the correct actions available.
Tests that a Team Drive directory entry has the correct actions available .
// "Share" is enabled for Team Drive directories. // "Manage in drive" is enabled for Team Drive directories. // 'Create shortcut' should be enabled.