Commit 165376d3 authored by benjaminParisel's avatar benjaminParisel Committed by jeromecambon

fix(exposedVariable): Remove variable value when var will be exposed (#2741)

Covers [UID-104](https://bonitasoft.atlassian.net/browse/UID-104)
parent 839acb58
......@@ -27,7 +27,7 @@ angular.module('bonitasoft.designer.editor.bottom-panel.data-panel').controller(
$scope.page.data[data.$$name] = {
exposed: data.exposed,
type: data.type,
value: data.value
value: $scope.isExposed(data) ? '' : data.value,
};
};
......
......@@ -42,6 +42,32 @@
expect(data).toEqual(jasmine.objectContaining($scope.page.data.colin));
});
it('should edit a data with default value', function() {
$scope.exposableData = true ;
$scope.page.data = {
$$name: 'myDataToEdit',
value: 'defaultValue',
exposed: false,
type: 'constant'
};
let dataToSave = {
$$name: 'myDataToEdit',
value: 'defaultValue',
exposed: true,
type: 'constant'
};
let expectedDataSaved = {
$$name: 'myDataToEdit',
value: '',
exposed: true,
type: 'constant'
};
$scope.save(dataToSave);
$scope.$apply();
expect(expectedDataSaved).toEqual(jasmine.objectContaining($scope.page.data.myDataToEdit));
});
it('should delete a data', function() {
$scope.page.data = { name: 'colin', value: 4 };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment