- Issue created by @kreynen
- last update
over 1 year ago 29,380 pass - Status changed to Needs review
over 1 year ago 7:07pm 9 May 2023 - Status changed to Needs work
over 1 year ago 7:48pm 9 May 2023 - ๐บ๐ธUnited States smustgrave
Think some simple test assertions would be good here.
- ๐บ๐ธUnited States kreynen
Happy to continue chipping away at this, but I'm going to need some direction on where to add tests.
A logical place to test this might be https://git.drupalcode.org/project/drupal/-/blob/9f0d07d02cb7055f550fbe5...โฆ]/tests/src/Functional/TaxonomyTermContentModerationTest.phpโฆ which doesnโt exist yet.
The way published/unpublished content is tested in https://git.drupalcode.org/project/drupal/-/blob/10.1.x/core/modules/nod... isnโt really a UI test.
https://git.drupalcode.org/project/drupal/-/blob/10.1.x/core/modules/tax... is only testing published terms. https://git.drupalcode.org/project/drupal/-/blob/10.1.x/core/modules/tax... is testing unpublished functionality... but in Views.
https://git.drupalcode.org/project/drupal/-/blob/10.1.x/core/modules/tax... gets into testing the admin/structure/taxonomy/manage/[vocabulary]
Does it make sense to add published and unpublished terms to test the new UI elements there?
- ๐บ๐ธUnited States kreynen
missed adding the column in foreach ($current_page in the first patch
- ๐บ๐ธUnited States luke.leber Pennsylvania
Following up from our mini-chat in slack.
I think that adding a simple assertion to https://git.drupalcode.org/project/drupal/-/blob/10.1.x/core/modules/tax... would be adequate for this. Rationality being that the published / unpublished status isn't dependent on content moderation being installed. Taxonomy terms have a
status
regardless, so surfacing it in the UI shouldn't hurt anything :-).Maybe something like this added around #L386?
// Check that the term is still present at admin UI after edit. $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/overview'); $this->assertSession()->pageTextContains($edit['name[0][value]']); $this->assertSession()->linkExists('Edit'); + $term->setUnpublished()->save(); + // Check that the term is now unpublished in the list. + $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/overview'); + $this->assertSession()->elementTextContains('css', "#edit-terms-tid{$term->id()}-status", 'Unpublished');
- First commit to issue fork.
- last update
over 1 year ago 29,425 pass, 2 fail - @bharath-kondeti opened merge request.
- Status changed to Needs review
over 1 year ago 3:36pm 9 June 2023 - last update
over 1 year ago 29,420 pass - last update
over 1 year ago 29,420 pass - ๐ฎ๐ณIndia bharath-kondeti Hyderabad
Added the test case as per #9 and raised an MR. Please review.
- Status changed to Needs work
over 1 year ago 7:06pm 9 June 2023 - First commit to issue fork.
- last update
over 1 year ago 29,811 pass - last update
over 1 year ago 29,811 pass - Status changed to Needs review
over 1 year ago 6:14am 12 July 2023 - ๐ฎ๐ณIndia ranjith_kumar_k_u Kerala
The variable $term is initialized at the first part of the function and after that, we made some updates to that term through UI, so the following code
$term->setUnpublished()->save();
is updating the term to the previous state and that is also causing failure to the tests after this, so that is why the code is updated like this// Unpublish the term. $this->drupalGet('taxonomy/term/' . $term->id() . '/edit'); $this->submitForm(["status[value]" => 0], 'Save');
- Status changed to RTBC
over 1 year ago 11:53am 12 July 2023 - ๐ฎ๐ณIndia keshavv India
I have tested the MR and also run the PHP Unit Test.
Mr looks good to me. I think we can go with it.Implementation Screenshot.
Unit test Screenshot.
- last update
over 1 year ago 29,812 pass - Status changed to Fixed
over 1 year ago 7:05am 14 July 2023 - ๐ฌ๐งUnited Kingdom catch
Nice little improvement to this page, can't see anything to complain about so committed/pushed to 11.x (for release in 10.2.x), thanks!
- ๐บ๐ธUnited States finagler
Thank you to all of the collaborators on this contribution, especially @kreynen for leading the charge. This should be a great improvement for the code base.
Automatically closed - issue fixed for 2 weeks with no activity.