Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 11, 2025

Three navigation menu test files were using POST instead of PUT for save operations, despite the API endpoint being defined as [HttpPut] in MenuController.cs. Additionally, these tests had unnecessary intercepts before editItemSave() calls that don't exist in the reference implementation.

Changes

  • Updated cy.intercept() calls from POST to PUT for main save operations in:
    • navigation-menu.delete-item.spec.cy.ts (3 occurrences)
    • navigation-menu.drag-item.spec.cy.ts (3 occurrences)
    • navigation-menu.edit-item.spec.cy.ts (9 occurrences)
  • Removed unnecessary saveMenuEdit intercepts and waits before editItemSave() calls in:
    • navigation-menu.drag-item.spec.cy.ts (1 occurrence)
    • navigation-menu.edit-item.spec.cy.ts (4 occurrences)

Example

// Before
cy.intercept('POST', '**/api/navigation-menu').as('saveMenu');
navigationMenuPage.clickSaveMenuBtn();
cy.wait('@saveMenu', { timeout: 30000 });

// ... later in test ...
cy.intercept('PUT', '**/api/navigation-menu').as('saveMenuEdit');
navigationMenuPage.editItemSave();
cy.wait('@saveMenuEdit', { timeout: 30000 });

// After
cy.intercept('PUT', '**/api/navigation-menu').as('saveMenu');
navigationMenuPage.clickSaveMenuBtn();
cy.wait('@saveMenu', { timeout: 30000 });

// ... later in test ...
navigationMenuPage.editItemSave();

Tests now fully align with both the API controller definition and the existing navigation-menu.create-item.spec.cy.ts reference implementation.

Original prompt

This section details on the original issue you should resolve

<issue_title>Fix delete,drag, edit and use create as reference</issue_title>
<issue_description>eform-client/cypress/e2e/c needs to be updated to test correctly</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix delete, drag, edit and use create as reference Fix HTTP method mismatch in navigation menu Cypress tests Nov 11, 2025
Copilot AI requested a review from renemadsen November 11, 2025 15:38
@renemadsen
Copy link
Member

@copilot look more closely at the reference create tests and adjust the other tests, so they don't do:

cy.intercept('PUT', '**/api/navigation-menu').as('saveMenuEdit');

Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 11, 2025

@copilot look more closely at the reference create tests and adjust the other tests, so they don't do:

cy.intercept('PUT', '**/api/navigation-menu').as('saveMenuEdit');

Removed all saveMenuEdit intercepts and waits before editItemSave() calls to match the reference implementation in navigation-menu.create-item.spec.cy.ts. Changes in commit 26575df.

Copilot AI changed the title Fix HTTP method mismatch in navigation menu Cypress tests Fix HTTP method mismatch and remove unnecessary intercepts in navigation menu Cypress tests Nov 11, 2025
@renemadsen renemadsen marked this pull request as ready for review November 11, 2025 17:04
@renemadsen renemadsen merged commit 6ccf392 into master Nov 11, 2025
24 of 29 checks passed
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.

Fix delete,drag, edit and use create as reference

3 participants