fix: resolve API intercept alias conflicts in linkShare and subtask-duplicates

- Fix multiple cy.intercept() calls with same '@loadTasks' alias
- Replace with single regex pattern in linkShare.spec.ts and subtask-duplicates.spec.ts
- Prevents Cypress from using only the last defined intercept
- Should resolve timeouts in link sharing and subtask duplicate tests

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude Loop
2025-09-21 06:53:25 +00:00
parent 44a1672e75
commit 46fdc61dd9
2 changed files with 6 additions and 12 deletions

View File

@@ -25,10 +25,8 @@ describe('Link shares', () => {
it('Can view a link share', () => {
const {share, project, tasks} = prepareLinkShare()
// Set up comprehensive API intercepts for all possible task loading endpoints BEFORE navigation
cy.intercept('GET', '**/api/v1/projects/*/views/*/tasks**').as('loadTasks')
cy.intercept('GET', '**/api/v1/projects/*/tasks**').as('loadTasks')
cy.intercept('GET', '**/api/v1/tasks/all**').as('loadTasks')
// Set up comprehensive API intercept for all possible task loading endpoints BEFORE navigation
cy.intercept('GET', /\/api\/v1\/(projects\/\d+(\/views\/\d+)?\/tasks|tasks\/all)/).as('loadTasks')
cy.visit(`/share/${share.hash}/auth`)
@@ -56,10 +54,8 @@ describe('Link shares', () => {
it('Should work when directly viewing a project with share hash present', () => {
const {share, project, tasks} = prepareLinkShare()
// Set up comprehensive API intercepts for all possible task loading endpoints BEFORE navigation
cy.intercept('GET', '**/api/v1/projects/*/views/*/tasks**').as('loadTasks')
cy.intercept('GET', '**/api/v1/projects/*/tasks**').as('loadTasks')
cy.intercept('GET', '**/api/v1/tasks/all**').as('loadTasks')
// Set up comprehensive API intercept for all possible task loading endpoints BEFORE navigation
cy.intercept('GET', /\/api\/v1\/(projects\/\d+(\/views\/\d+)?\/tasks|tasks\/all)/).as('loadTasks')
cy.visit(`/projects/${project.id}/1#share-auth-token=${share.hash}`)

View File

@@ -53,10 +53,8 @@ describe('Subtask duplicate handling', () => {
it('shows subtask only once in project list', () => {
// Add API intercepts to wait for all necessary data to load
// Set up comprehensive API intercepts for all possible task loading endpoints
cy.intercept('GET', '**/api/v1/projects/*/views/*/tasks**').as('loadTasks')
cy.intercept('GET', '**/api/v1/projects/*/tasks**').as('loadTasks')
cy.intercept('GET', '**/api/v1/tasks/all**').as('loadTasks')
// Set up comprehensive API intercept for all possible task loading endpoints
cy.intercept('GET', /\/api\/v1\/(projects\/\d+(\/views\/\d+)?\/tasks|tasks\/all)/).as('loadTasks')
cy.intercept('GET', '**/api/v1/projects/*').as('loadProject')
cy.intercept('GET', '**/api/v1/tasks/*/relations').as('loadTaskRelations')