Skip to content

Commit

Permalink
fix(pipelines): prevent pipelineConfig pollution caused by retrying a…
Browse files Browse the repository at this point in the history
… trigger unsuccessfully. (#8287)

* fix(pipelines): prevent pipelineConfig pollution caused by retrying a trigger unsuccessfully.

* fix(pipelines): fix broken unit test

* fix(pipelines): update test case
  • Loading branch information
cristhian-castaneda committed May 26, 2020
1 parent f4d5ea8 commit 3f2afb7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ module(CORE_PIPELINE_CONFIG_PIPELINECONFIG_CONTROLLER, [UIROUTER_ANGULARJS]).con
if (!app.notFound && !app.hasError) {
app.pipelineConfigs.activate();
app.pipelineConfigs
.ready()
.refresh()
.then(this.initialize)
.then(() => (this.state.pipelinesLoaded = true));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('Controller: PipelineConfigCtrl', function() {
}),
);

it('should initialize immediately if pipeline configs are already present', function() {
it('should reload pipeline configs even if are already loaded before initializing', function() {
const application = ApplicationModelBuilder.createApplicationForTests('app', {
key: 'pipelineConfigs',
lazy: true,
Expand All @@ -29,6 +29,11 @@ describe('Controller: PipelineConfigCtrl', function() {
},
app: application,
});
application.pipelineConfigs.activate();
application.pipelineConfigs.refresh();
application.pipelineConfigs.data.push({ id: 'a' });
application.pipelineConfigs.dataUpdated();

scope.$digest();
expect(vm.state.pipelinesLoaded).toBe(true);
});
Expand Down

0 comments on commit 3f2afb7

Please sign in to comment.