Skip to content

Conversation

@dmcintyr-akamai
Copy link
Contributor

@dmcintyr-akamai dmcintyr-akamai commented May 15, 2025

Description 📝

Add test for Longview create page for restricted users. There is already a test for a user w/ restricted permissions in packages/manager/cypress/e2e/core/account/restricted-user-details-pages.spec.ts but the user in this test has "read only" permissions and isn't fully restricted. In restricted-user-details-pages.spec.ts, the user is able to view Longview plans but not create them. In this test that i added, the user cannot create or view any plans.

Changes 🔄

Add test for user that is restricted and has add_longview and longview_subscription set to false. Verify that user cannot see the "Add Client" button or the table that would display the plan data.

Also had to mock result from longview/plan to return a 403 error to simulate api response for restricted user.

How to test 🧪

pnpm run cy:run -s cypress/e2e/core/longview/longview-plan.spec.ts

Author Checklists

As an Author, to speed up the review process, I considered 🤔

👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All unit tests are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

Commit message and pull request title format standards

Note: Remove this section before opening the pull request
Make sure your PR title and commit message on squash and merge are as shown below

<commit type>: [JIRA-ticket-number] - <description>

Commit Types:

  • feat: New feature for the user (not a part of the code, or ci, ...).
  • fix: Bugfix for the user (not a fix to build something, ...).
  • change: Modifying an existing visual UI instance. Such as a component or a feature.
  • refactor: Restructuring existing code without changing its external behavior or visual UI. Typically to improve readability, maintainability, and performance.
  • test: New tests or changes to existing tests. Does not change the production code.
  • upcoming: A new feature that is in progress, not visible to users yet, and usually behind a feature flag.

Example: feat: [M3-1234] - Allow user to view their login history


@dmcintyr-akamai dmcintyr-akamai marked this pull request as ready for review May 16, 2025 10:52
@dmcintyr-akamai dmcintyr-akamai requested review from a team as code owners May 16, 2025 10:52
@dmcintyr-akamai dmcintyr-akamai requested review from dwiley-akamai, harsh-akamai and jdamore-linode and removed request for a team May 16, 2025 10:52
Copy link
Contributor

@dwiley-akamai dwiley-akamai left a comment

Choose a reason for hiding this comment

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

I got timeouts when I tried running it locally, but it passes in CI ✅

…stricted' of github.com:dmcintyr-akamai/manager into M3-9597_longview_restricted
@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 3 failing tests on test run #4 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
3 Failing591 Passing4 Skipped133m 43s

Details

Failing Tests
SpecTest
lke-create.spec.tsCloud Manager Cypress Tests→LKE Cluster Creation » LKE Cluster Creation
lke-create.spec.tsCloud Manager Cypress Tests→LKE Cluster Creation with APL enabled » LKE Cluster Creation with APL enabled
clone-linode.spec.tsCloud Manager Cypress Tests→clone linode » clone linode

Troubleshooting

Use this command to re-run the failing tests:

pnpm cy:run -s "cypress/e2e/core/kubernetes/lke-create.spec.ts,cypress/e2e/core/linodes/clone-linode.spec.ts"

Copy link
Contributor

@jdamore-linode jdamore-linode left a comment

Choose a reason for hiding this comment

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

@github-project-automation github-project-automation bot moved this from Review to Approved in Cloud Manager May 19, 2025
@dmcintyr-akamai dmcintyr-akamai merged commit ce3206f into linode:develop May 20, 2025
34 of 35 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Merged in Cloud Manager May 20, 2025
@dmcintyr-akamai dmcintyr-akamai deleted the M3-9597_longview_restricted branch May 20, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants