Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should return dataset parameters', inject(($rootScope, state, PlaygroundService) => {
state.playground.isReadOnly = false;
state.playground.parameters.visible = false;
state.playground.lookup.loading = false;
const action = PlaygroundService.getDatasetParametersAction();
expect(action[0].id).toEqual('playground-metadata');
expect(action[0].icon).toEqual('talend-cog');
expect(action[0].label).toEqual('Edit dataset parameters (encoding, separator, etc.)');
expect(action[0].displayMode).toEqual(Action.DISPLAY_MODE_ICON_TOGGLE);
expect(action[0].active).toEqual(false);
expect(action[0].inProgress).toEqual(false);
}));
function getDatasetParametersAction() {
return state.playground.isReadOnly || SettingsService.isCatalog() ? [] : [{
id: 'playground-metadata',
label: $translate.instant('DATAGRID_PARAMETERS_GEAR'),
icon: 'talend-cog',
displayMode: Action.DISPLAY_MODE_ICON_TOGGLE,
active: state.playground.parameters.visible,
onClick: () => $timeout(StateService.toggleDatasetParameters),
inProgress: state.playground.lookup.loading,
}];
}