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

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

        // "share" action is disabled for Team Drive Root entries.
        var shareAction = actions[ActionsModel.CommonActionId.SHARE];
        assertTrue(!!shareAction);
        assertFalse(shareAction.canExecute());

        // "manage in drive" action is disabled for Team Drive Root entries.
        var manageAction =
            actions[ActionsModel.InternalActionId.MANAGE_IN_DRIVE];
        assertTrue(!!manageAction);
        assertFalse(manageAction.canExecute());
      }),
      callback);
}
/**
 * Tests that a Team Drive Root entry has the correct actions available.
 */
Tests that a Team Drive Root entry has the correct actions available.
Tests that a Team Drive Root entry has the correct actions available .
function testTeamDriveRootEntry(callback) {
  driveFileSystem.entries['/team_drives/ABC Team'] =
      new MockDirectoryEntry(driveFileSystem, '/team_drives/ABC Team', {});
  var model = new ActionsModel(
      volumeManager, metadataModel, shortcutsModel, driveSyncHandler, ui,
      [driveFileSystem.entries['/team_drives/ABC Team']]);
  return reportPromise(
      model.initialize().then(function() {
        var actions = model.getActions();
        assertEquals(2, Object.keys(actions).length);
        var shareAction = actions[ActionsModel.CommonActionId.SHARE];
        assertTrue(!!shareAction);
        assertFalse(shareAction.canExecute());
        var manageAction =
            actions[ActionsModel.InternalActionId.MANAGE_IN_DRIVE];
        assertTrue(!!manageAction);
        assertFalse(manageAction.canExecute());
      }),
      callback);
}
function testTeamDriveRootEntry ( callback ) { driveFileSystem . entries [ '/team_drives/ABC Team' ] = new MockDirectoryEntry ( driveFileSystem , '/team_drives/ABC Team' , { } ) ; var model = new ActionsModel ( volumeManager , metadataModel , shortcutsModel , driveSyncHandler , ui , [ driveFileSystem . entries [ '/team_drives/ABC Team' ] ] ) ; return reportPromise ( model . initialize ( ) . then ( function ( ) { var actions = model . getActions ( ) ; assertEquals ( 2 , Object . keys ( actions ) . length ) ; var shareAction = actions [ ActionsModel . CommonActionId . SHARE ] ; assertTrue ( ! ! shareAction ) ; assertFalse ( shareAction . canExecute ( ) ) ; var manageAction = actions [ ActionsModel . InternalActionId . MANAGE_IN_DRIVE ] ; assertTrue ( ! ! manageAction ) ; assertFalse ( manageAction . canExecute ( ) ) ; } ) , callback ) ; }
Tests that a Team Drive Root entry has the correct actions available.
Tests that a Team Drive Root entry has the correct actions available .
// "share" action is disabled for Team Drive Root entries. // "manage in drive" action is disabled for Team Drive Root entries.