Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: discard-and-proceed not working when creating new attribution #2637

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export function setSelectedResourceOrAttributionIdToTargetValue(): AppThunkActio
const targetSelectedAttributionId =
getTargetSelectedAttributionId(getState());

if (targetSelectedResourceId) {
if (targetSelectedResourceId !== null) {
dispatch(setSelectedResourceId(targetSelectedResourceId));
dispatch(setTargetSelectedResourceId(null));
}

if (targetSelectedAttributionId) {
if (targetSelectedAttributionId !== null) {
dispatch(setSelectedAttributionId(targetSelectedAttributionId));
dispatch(setTargetSelectedAttributionId(null));
}
Expand Down
4 changes: 1 addition & 3 deletions src/e2e-tests/__tests__/updating-attributions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ test('warns user of unsaved changes if user attempts to navigate away before sav
await notSavedPopup.assert.isVisible();

await notSavedPopup.discardButton.click();
await attributionDetails.attributionForm.assert.matchesPackageInfo(
packageInfo1,
);
await attributionDetails.attributionForm.assert.isEmpty();

await attributionDetails.attributionForm.comment.fill(
faker.lorem.sentences(),
Expand Down
Loading