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

remove authorization mocks left over from PR #1105 #1376

Merged
merged 1 commit into from
Oct 26, 2021

Conversation

artlowel
Copy link
Member

References

Description

#1105 added mocks for the authorization calls for certain features on certain items. From the PR description:

Mocks:
Since we're waiting on the REST PR to add some of the feature endpoints, I've added mocks for these endpoints on certain items. Rest api containing these items: https://api7.dspace.org/server/#/server/api

  • Authorization for canManageBitstreams is mocked for item 96715576-3748-4761-ad45-001646632963
  • Authorization for canManageRelationships is mocked for item 047556d1-3d01-4c53-bc68-0cee7ad7ed4e
  • Authorizations for canManageVersions and canManageMappings are mocked for item e98b0f27-5c19-49a0-960d-eb6ad5287067

How to test:

  • Visit the edit item page for the following items:
    ** 96715576-3748-4761-ad45-001646632963: The bitstreams tab should be available. Relationships, versions and collection mapper should be inaccessible. The collection mapper action on the status page should also be disabled and show a tooltip when hovered over.
    ** 047556d1-3d01-4c53-bc68-0cee7ad7ed4e: The relationships tab should be available. Bitstreams, versions and collection mapper should be inaccessible. The collection mapper action on the status page should also be disabled and show a tooltip when hovered over.
    ** e98b0f27-5c19-49a0-960d-eb6ad5287067: The versions and collection mapper tabs should be available. Bitstreams and relationships should be inaccessible. The collection mapper action on the status page should be active and link to the collection mapper tab.
    ** Visiting any other item's edit page should have all the above actions disabled

As a consequence, if you visit any of these items in dev mode, you'd get the mocked response instead of the actual response from the server. In prod mode, the server responses are always used.

Instructions for Reviewers

Visit the edit page for the items mentioned above using the demo backend, and verify that you have access to the same tabs as you would on the demo server, not the ones mentioned in the quoted description above.

Checklist

  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes TSLint validation using yarn run lint
  • My PR doesn't introduce circular dependencies
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • If my PR includes new, third-party dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.

@artlowel artlowel added the 1 APPROVAL pull request only requires a single approval to merge label Oct 26, 2021
@artlowel artlowel added this to the 7.1 milestone Oct 26, 2021
Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

👍 Looks good @artlowel ! Thanks! GitHub CI also succeeds, which proves that the tests work without these mocks.

@tdonohue tdonohue merged commit 2fe9fbd into DSpace:main Oct 26, 2021
@artlowel artlowel deleted the remove-authorization-mocks branch October 27, 2021 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 APPROVAL pull request only requires a single approval to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants