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

PIN-5883 deletePurpose delegation test #1338

Open
wants to merge 36 commits into
base: feature/incaricato
Choose a base branch
from

Conversation

rGregnanin
Copy link
Contributor

No description provided.

@rGregnanin rGregnanin marked this pull request as ready for review January 10, 2025 16:21
);
});

it("should throw organizationIsNotTheConsumer when the requester is the Consumer with no delegation and is deleting a purpose created by a delegate in deletePurpose", async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!
You could also add two tests for the following error cases:

  1. the requester is a delegate for the eservice and is deleting a purpose with no delegationId
  2. the requester is a delegate for the eservice and is deleting a purpose for a different delegationId (a different delegate)

Comment on lines 416 to 421
const mockPurpose: Purpose = {
...getMockPurpose(),
eserviceId: mockEService.id,
versions: [mockPurposeVersion],
delegationId: generateId<DelegationId>(),
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const mockPurpose: Purpose = {
...getMockPurpose(),
eserviceId: mockEService.id,
versions: [mockPurposeVersion],
delegationId: generateId<DelegationId>(),
};
const mockPurpose: Purpose = {
...getMockPurpose(),
eserviceId: mockEService.id,
versions: [mockPurposeVersion],
delegationId: generateId<DelegationId>(),
consumerId: authData.organizationId
};

Base automatically changed from PIN-5881-UpdatePurposeDelegtionTest to feature/incaricato January 17, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants