Unit/System Tests Webservices PR-6.2-dev Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
16 Oct 2026
  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

Add test for deleting a content category via DELETE verb

Testing Instructions

run npx cypress run --spec tests/System/integration/api/com_content/Categories.cy.js

Actual result BEFORE applying this Pull Request

N/A

Expected result AFTER applying this Pull Request

a test

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar alikon alikon - open - 16 Oct 2026
avatar alikon alikon - change - 16 Oct 2026
Status New ⇒ Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Oct 2026
Category ⇒ JavaScript Unit Tests
avatar tecpromotion tecpromotion - test_item - 16 Oct 2026 - Tested unsuccessfully
avatar tecpromotion
tecpromotion - comment - 16 Oct 2026

I have tested this item 🔴 unsuccessfully on 8774a3d


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48643.

avatar tecpromotion
tecpromotion - comment - 16 Oct 2026

I have tested this item 🔴 unsuccessfully on 8774a3d


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48643.

avatar tecpromotion
tecpromotion - comment - 16 Oct 2026

I have tested this item 🔴 unsuccessfully on 8774a3d


The test passes, but the category is not deleted.

db_createCategory inserts the row without an asset (asset_id = 0). Nested::delete() then returns false without an error, and ApiController::delete() still answers 204. Checking the DB right after the DELETE:

Category DELETE Row afterwards
db_createCategory(... published: -2) (this PR) 204 still there
created via API, PATCH published: -2 204 gone

Suggested test (verified locally, passes):

it('can delete a category', () => {
  cy.api_post('/content/categories', { title: 'automated test content category', parent_id: 1, extension: 'com_content' })
    .then((response) => response.body.data.id)
    .then((id) => cy.api_patch(`/content/categories/${id}`, { published: -2 })
      .then(() => cy.api_delete(`/content/categories/${id}`))
      .then((response) => expect(response.status).to.equal(204))
      .then(() => cy.task('queryDB', `SELECT id FROM #__categories WHERE id = ${id}`))
      .then((rows) => expect(rows).to.have.length(0)));
});

Side note (core, separate issue): the API returns 204 whenever $model->delete() fails without an error message, e.g. a trashed category that still contains articles.

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48643.

avatar alikon alikon - change - 18 Oct 2026
Labels Added: Unit/System Tests Webservices PR-6.2-dev
avatar ThomasFinnern ThomasFinnern - test_item - 30 Oct 2026 - Tested successfully
avatar ThomasFinnern
ThomasFinnern - comment - 30 Oct 2026

I have tested this item ✅ successfully on 77700e8

The command runs through
result:
(Run Finished)

   Spec                                              Tests  Passing  Failing  Pending  Skipped

┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ √ Categories.cy.js 00:33 7 7 - - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
√ All specs passed! 00:33 7 7 - - -

Before the PR was applied it was 6 Tests
There is no new category or trashed category in the backend view

asset table
The test should check for left over item in the asset table too
After each tests there are one more left over item there.
We discussed on "Happy Testing Friday" that asset table
is actually never tested with cypress test

Heiko will write an issue about it.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48643.
avatar ThomasFinnern
ThomasFinnern - comment - 30 Oct 2026

I have tested this item ✅ successfully on 77700e8

The command runs through
result:
(Run Finished)

   Spec                                              Tests  Passing  Failing  Pending  Skipped

┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ √ Categories.cy.js 00:33 7 7 - - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
√ All specs passed! 00:33 7 7 - - -

Before the PR was applied it was 6 Tests
There is no new category or trashed category in the backend view

asset table
The test should check for left over item in the asset table too
After each tests there are one more left over item there.
We discussed on "Happy Testing Friday" that asset table
is actually never tested with cypress test

Heiko will write an issue about it.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48643.
avatar muhme muhme - test_item - 30 Oct 2026 - Tested unsuccessfully
avatar muhme
muhme - comment - 30 Oct 2026

I have tested this item 🔴 unsuccessfully on 77700e8

The test is running and the deleted category is no more visible in backend, but there are still entries left in _assets table, see #48735


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48643.

avatar muhme
muhme - comment - 30 Oct 2026

I have tested this item 🔴 unsuccessfully on 77700e8

The test is running and the deleted category is no more visible in backend, but there are still entries left in _assets table, see #48735


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48643.

avatar alikon
alikon - comment - 30 Oct 2026

that will be sovled from #48648

avatar alikon
alikon - comment - 30 Oct 2026

that will be sovled from #48648

avatar alikon
alikon - comment - 3 Nov 2026

i'm unable to replicate you findings see #48735 (comment)

avatar github-actions[bot]
github-actions[bot] - comment - 7 Nov 2026

This pull request has conflicts, please resolve those before we can evaluate the pull request.

avatar richard67
richard67 - comment - 7 Nov 2026

@alikon Now as PR #48648 has been merged, you might have to adjust your new test here. See in that PR's description:

Note: the test proposed in #48643 creates the category with db_createCategory (no asset row). With this fix its delete returns 409 instead of a false 204, so that test needs to create the category via the API.

@tecpromotion Can you confirm this? Or did I misunderstand something?

And it needs to fix a merge conflict here in file tests/System/integration/api/com_content/Categories.cy.js.

Add a Comment

Login with GitHub to post a comment