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

feat: add more validation to resource.router and add test cases #725

Merged
merged 17 commits into from
Oct 11, 2024

Conversation

karrui
Copy link
Contributor

@karrui karrui commented Oct 4, 2024

Second part of the PR. This PR adds tests for resource.router

Blocked by #729

Copy link

vercel bot commented Oct 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
isomer-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2024 10:58am

Copy link
Contributor Author

karrui commented Oct 4, 2024

@karrui karrui changed the title test: add test cases for resource.getMetadataById feat: add more validation to resource.router and add test cases Oct 4, 2024
@karrui karrui marked this pull request as ready for review October 4, 2024 07:44
@karrui karrui requested a review from a team as a code owner October 4, 2024 07:44
@datadog-opengovsg
Copy link

datadog-opengovsg bot commented Oct 4, 2024

Datadog Report

Branch report: resource_router_tests
Commit report: 2d681a3
Test service: isomer-studio

✅ 0 Failed, 129 Passed, 23 Skipped, 25.76s Total Time

@karrui
Copy link
Contributor Author

karrui commented Oct 8, 2024

This PR breaks frontend for now since frontend calls the getChildrenOf procedure regardless of type. I'm updating the behaviour in #729 to fix this (and have the tighter validation)

expect(result).toMatchObject(expected)
})

it.skip("should throw 403 if user does not have write access to destination resource", async () => {})
Copy link
Contributor

Choose a reason for hiding this comment

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

we might need 1 more (skipped) test case: admin can move folders/pages from anywhere to root

it.skip("should throw 403 if user does not have read access to the resource", async () => {})
})

describe("delete", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

need a test case checking that the user cannot delete the root page

Copy link
Contributor Author

karrui commented Oct 11, 2024

Merge activity

  • Oct 11, 5:55 AM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Oct 11, 6:00 AM EDT: Graphite couldn't merge this pull request because a downstack PR fix: page router validations and add test cases #720 failed to merge.
  • Oct 11, 6:07 AM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Oct 11, 6:09 AM EDT: Graphite couldn't merge this PR because it had conflicts with the trunk branch.
  • Oct 11, 6:17 AM EDT: A user merged this pull request with Graphite.

@karrui karrui changed the base branch from page_router_tests to graphite-base/725 October 11, 2024 10:04
@karrui karrui changed the base branch from graphite-base/725 to main October 11, 2024 10:07
@karrui karrui force-pushed the resource_router_tests branch from dcfaa42 to b03df30 Compare October 11, 2024 10:10
@karrui karrui merged commit 5017e84 into main Oct 11, 2024
18 of 19 checks passed
@karrui karrui deleted the resource_router_tests branch October 11, 2024 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants