Skip to content

Commit a69da7a

Browse files
committed
fix: discard-and-proceed not working when creating new attribution
- adjust check setting the selected attribution to distinguish between null and empty string Fixes #2635 Signed-off-by: Maxim Stykow <maxim.stykow@tngtech.com>
1 parent 47e0d6d commit a69da7a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/Frontend/state/actions/resource-actions/navigation-actions.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ export function setSelectedResourceOrAttributionIdToTargetValue(): AppThunkActio
3636
const targetSelectedAttributionId =
3737
getTargetSelectedAttributionId(getState());
3838

39-
if (targetSelectedResourceId) {
39+
if (targetSelectedResourceId !== null) {
4040
dispatch(setSelectedResourceId(targetSelectedResourceId));
4141
dispatch(setTargetSelectedResourceId(null));
4242
}
4343

44-
if (targetSelectedAttributionId) {
44+
if (targetSelectedAttributionId !== null) {
4545
dispatch(setSelectedAttributionId(targetSelectedAttributionId));
4646
dispatch(setTargetSelectedAttributionId(null));
4747
}

src/e2e-tests/__tests__/updating-attributions.test.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ test('warns user of unsaved changes if user attempts to navigate away before sav
9797
await notSavedPopup.assert.isVisible();
9898

9999
await notSavedPopup.discardButton.click();
100-
await attributionDetails.attributionForm.assert.matchesPackageInfo(
101-
packageInfo1,
102-
);
100+
await attributionDetails.attributionForm.assert.isEmpty();
103101

104102
await attributionDetails.attributionForm.comment.fill(
105103
faker.lorem.sentences(),

0 commit comments

Comments
 (0)