function testTeamDriveFileEntry(callback) {
  driveFileSystem.entries['/team_drives/ABC Team/Folder 1/test.txt'] =
      new MockFileEntry(
          driveFileSystem, '/team_drives/ABC Team/Folder 1/test.txt', {});

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

        // "save for offline" action is enabled for Team Drive file entries.
        var saveForOfflineAction =
            actions[ActionsModel.CommonActionId.SAVE_FOR_OFFLINE];
        assertTrue(!!saveForOfflineAction);
        assertTrue(saveForOfflineAction.canExecute());

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

        // "manage in drive" action is enabled for Team Drive file entries.
        var manageAction =
            actions[ActionsModel.InternalActionId.MANAGE_IN_DRIVE];
        assertTrue(!!manageAction);
        assertTrue(manageAction.canExecute());
      }),
      callback);
}
/**
 * Tests that a Team Drive file entry has the correct actions available.
 */
Tests that a Team Drive file entry has the correct actions available.
Tests that a Team Drive file entry has the correct actions available .
function testTeamDriveFileEntry(callback) {
  driveFileSystem.entries['/team_drives/ABC Team/Folder 1/test.txt'] =
      new MockFileEntry(
          driveFileSystem, '/team_drives/ABC Team/Folder 1/test.txt', {});
  var model = new ActionsModel(
      volumeManager, metadataModel, shortcutsModel, driveSyncHandler, ui,
      [driveFileSystem.entries['/team_drives/ABC Team/Folder 1/test.txt']]);
  metadataModel.properties = {hosted: false, pinned: false};
  return reportPromise(
      model.initialize().then(function() {
        var actions = model.getActions();
        assertEquals(3, Object.keys(actions).length);
        var saveForOfflineAction =
            actions[ActionsModel.CommonActionId.SAVE_FOR_OFFLINE];
        assertTrue(!!saveForOfflineAction);
        assertTrue(saveForOfflineAction.canExecute());
        var shareAction = actions[ActionsModel.CommonActionId.SHARE];
        assertTrue(!!shareAction);
        assertTrue(shareAction.canExecute());
        var manageAction =
            actions[ActionsModel.InternalActionId.MANAGE_IN_DRIVE];
        assertTrue(!!manageAction);
        assertTrue(manageAction.canExecute());
      }),
      callback);
}
function testTeamDriveFileEntry ( callback ) { driveFileSystem . entries [ '/team_drives/ABC Team/Folder 1/test.txt' ] = new MockFileEntry ( driveFileSystem , '/team_drives/ABC Team/Folder 1/test.txt' , { } ) ; var model = new ActionsModel ( volumeManager , metadataModel , shortcutsModel , driveSyncHandler , ui , [ driveFileSystem . entries [ '/team_drives/ABC Team/Folder 1/test.txt' ] ] ) ; metadataModel . properties = { hosted : false , pinned : false } ; return reportPromise ( model . initialize ( ) . then ( function ( ) { var actions = model . getActions ( ) ; assertEquals ( 3 , Object . keys ( actions ) . length ) ; var saveForOfflineAction = actions [ ActionsModel . CommonActionId . SAVE_FOR_OFFLINE ] ; assertTrue ( ! ! saveForOfflineAction ) ; assertTrue ( saveForOfflineAction . canExecute ( ) ) ; var shareAction = actions [ ActionsModel . CommonActionId . SHARE ] ; assertTrue ( ! ! shareAction ) ; assertTrue ( shareAction . canExecute ( ) ) ; var manageAction = actions [ ActionsModel . InternalActionId . MANAGE_IN_DRIVE ] ; assertTrue ( ! ! manageAction ) ; assertTrue ( manageAction . canExecute ( ) ) ; } ) , callback ) ; }
Tests that a Team Drive file entry has the correct actions available.
Tests that a Team Drive file entry has the correct actions available .
// "save for offline" action is enabled for Team Drive file entries. // "share" action is enabled for Team Drive file entries. // "manage in drive" action is enabled for Team Drive file entries.