Skip to content

Conversation

Migaroez
Copy link
Contributor

Description

Added a test for the logic introduced in #20083
Updated the GetManagementApiUrl logic to allow for not having to specify the version on the controller/method.

@Migaroez Migaroez changed the title V16/feature/parent sibling folder tests Add test for sibling endpoint returning parent id even when its a folder Sep 10, 2025
Copy link
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

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

Thanks @Migaroez - looks good and can see if verifies the added functionality.

Only concern is that it feels a little odd this being literally the only test for a management API controller. But I guess so long as it's adding value that's OK, and others could be more easily added in future following the pattern.

using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Tests.Common.Builders;

namespace Umbraco.Cms.Tests.Integration.ManagementApi.Trees;
Copy link
Contributor

Choose a reason for hiding this comment

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

For alignment with the main project, perhaps namespace and folder should be: Umbraco.Cms.Tests.Integration.ManagementApi.Controllers.DocumentType.Trees

Migaroez and others added 2 commits September 17, 2025 09:39
…peSiblingControllerTests.cs

Co-authored-by: Andy Butland <[email protected]>
…peSiblingControllerTests.cs

Co-authored-by: Andy Butland <[email protected]>
@Migaroez
Copy link
Contributor Author

Only concern is that it feels a little odd this being literally the only test for a management API controller.

Yeah I agree, but it's because the logic there shouldn't be in a controller. When that logic is moved, this test can be moved too and the entrypoint changed while the setup and assert can be more or less the same.

Copy link
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

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

Then approving. As you say, maybe it can go away in the future, or it can serve as a basis for other tests on logic in the controllers where it's not straightforward to place or move.

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