This is an automated email from the ASF dual-hosted git repository.
scottyaslan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new 125ef347d0 NIFI-15095: Ensure that replay subjects are complete after
each execution and teardown the testing module in between tests. (#10422)
125ef347d0 is described below
commit 125ef347d0c5daa1ecca7b15b123237aefef821b
Author: Matt Gilman <[email protected]>
AuthorDate: Wed Oct 15 14:29:02 2025 -0400
NIFI-15095: Ensure that replay subjects are complete after each execution
and teardown the testing module in between tests. (#10422)
---
nifi-frontend/src/main/frontend/apps/nifi/setup-jest.ts | 6 +++++-
.../state/counter-listing/counter-listing.effects.spec.ts | 10 +++++++++-
.../app/pages/flow-designer/state/flow/flow.effects.spec.ts | 6 ++++++
.../parameter-context-listing.effects.spec.ts | 6 ++++++
4 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/nifi-frontend/src/main/frontend/apps/nifi/setup-jest.ts
b/nifi-frontend/src/main/frontend/apps/nifi/setup-jest.ts
index ae0fe1e800..d8231abd3a 100644
--- a/nifi-frontend/src/main/frontend/apps/nifi/setup-jest.ts
+++ b/nifi-frontend/src/main/frontend/apps/nifi/setup-jest.ts
@@ -14,9 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone';
setupZoneTestEnv({
errorOnUnknownElements: true,
- errorOnUnknownProperties: true
+ errorOnUnknownProperties: true,
+ teardown: {
+ destroyAfterEach: true
+ }
});
diff --git
a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/counters/state/counter-listing/counter-listing.effects.spec.ts
b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/counters/state/counter-listing/counter-listing.effects.spec.ts
index 4d74bcfa82..2a6f494b67 100644
---
a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/counters/state/counter-listing/counter-listing.effects.spec.ts
+++
b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/counters/state/counter-listing/counter-listing.effects.spec.ts
@@ -30,6 +30,8 @@ import { HttpErrorResponse } from '@angular/common/http';
import { CounterEntity } from './index';
describe('CounterListingEffects', () => {
+ let action$: ReplaySubject<Action>;
+
interface SetupOptions {
counterListingState?: any;
}
@@ -100,7 +102,7 @@ describe('CounterListingEffects', () => {
const dispatchSpy = jest.spyOn(store, 'dispatch');
const effects = TestBed.inject(CounterListingEffects);
- const action$ = new ReplaySubject<Action>();
+ action$ = new ReplaySubject<Action>();
const countersService = TestBed.inject(CountersService);
const dialog = TestBed.inject(MatDialog);
@@ -109,6 +111,12 @@ describe('CounterListingEffects', () => {
return { effects, action$, store, dispatchSpy, countersService,
dialog, errorHelper };
}
+ afterEach(() => {
+ if (action$) {
+ action$.complete();
+ }
+ });
+
it('should create', async () => {
const { effects } = await setup();
expect(effects).toBeTruthy();
diff --git
a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/state/flow/flow.effects.spec.ts
b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/state/flow/flow.effects.spec.ts
index 7c264d95c6..d48a391558 100644
---
a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/state/flow/flow.effects.spec.ts
+++
b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/state/flow/flow.effects.spec.ts
@@ -907,6 +907,12 @@ describe('FlowEffects', () => {
jest.spyOn(store, 'dispatch');
});
+ afterEach(() => {
+ if (action$) {
+ action$.complete();
+ }
+ });
+
describe('#moveToFront', () => {
it('calls the flow service to update the component when max index
matches request index', async () => {
const REQUEST: MoveToFrontRequest = {
diff --git
a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/parameter-contexts/state/parameter-context-listing/parameter-context-listing.effects.spec.ts
b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/parameter-contexts/state/parameter-context-listing/parameter-context-listing.effects.spec.ts
index 698fd469c0..e384df3ab4 100644
---
a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/parameter-contexts/state/parameter-context-listing/parameter-context-listing.effects.spec.ts
+++
b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/parameter-contexts/state/parameter-context-listing/parameter-context-listing.effects.spec.ts
@@ -88,6 +88,12 @@ describe('ParameterContextListingEffects', () => {
jest.clearAllMocks();
});
+ afterEach(() => {
+ if (action$) {
+ action$.complete();
+ }
+ });
+
it('should create', async () => {
const { effects } = await setup();
expect(effects).toBeTruthy();