Skip to content
Snippets Groups Projects
Commit d5f81431 authored by Jonathan Smith's avatar Jonathan Smith Committed by Stephen Mustgrave
Browse files

Issue #3413467: Availbale Updates radio buttons

parent 62950119
No related branches found
No related tags found
1 merge request!43Issue #3413467: Availbale Updates radio buttons
Pipeline #79426 passed
......@@ -50,8 +50,13 @@ include:
################
variables:
# Add extra phpunit job for the previous core minor version.
OPT_IN_TEST_PREVIOUS_MAJOR: 1
OPT_IN_TEST_PREVIOUS_MINOR: 1
OPT_IN_TEST_NEXT_MINOR: 0
OPT_IN_TEST_NEXT_MAJOR: 0
OPT_IN_TEST_MAX_PHP: 0
# concurrent=1 uses run-tests.sh, 0 uses phpunit directly.
_PHPUNIT_CONCURRENT: 1
eslint:
before_script:
......@@ -66,30 +71,24 @@ stylelint:
phpcs:
allow_failure: false
phpunit (previous minor):
allow_failure: false
before_script:
# Provide some context on the test run. This is also done later, but the job will halt if the patching fails, so do it here too.
- vendor/bin/drush status
# Apply core patches
- cd $CI_PROJECT_DIR/$_WEB_ROOT
# Apply core patch from https://www.drupal.org/project/drupal/issues/2895388 which is on MR 3273 (for core 10.1) and MR 5496 for 10.2
# This adds the machine to the uninstall page and includes the small tableresponsive change from issue 3331975
# @todo Remove this when the above issue is committed and the new core version is used in this job step.
- curl https://git.drupalcode.org/project/drupal/-/merge_requests/3273.diff | patch -p1 --verbose
- cd $CI_PROJECT_DIR
# Add re-usable reference for applying the core patches in all phpunit tests.
.module-filter-core-patches: &module-filter-core-patches
# Provide some context on the test run. This is also done later, but the job will halt if the patching fails, so do it here too.
- drush status
# Apply core patch from https://www.drupal.org/project/drupal/issues/2895388 which is on MR 3273 (for core 10.1) and MR 5496 for 10.2
# This adds the machine to the uninstall page and includes the small tableresponsive change from issue 3331975
# @todo Remove this when the above issue is committed and the new core version is used in this job step.
- echo $_TARGET_CORE | grep 10.1 && export MR_DIFF="3273.diff"
- echo $_TARGET_CORE | grep 10.2 && export MR_DIFF="5496.diff"
- echo $_TARGET_CORE | grep 11. && export MR_DIFF="5496.diff"
- echo "_TARGET_CORE=$_TARGET_CORE, MR_DIFF is $MR_DIFF"
- |
if [ "$MR_DIFF" != "" ]; then
cd $CI_PROJECT_DIR/$_WEB_ROOT
curl https://git.drupalcode.org/project/drupal/-/merge_requests/$MR_DIFF | patch -p1
cd $CI_PROJECT_DIR
fi
phpunit:
# The Tests pass at 10.1 so allow failure at 10.2
# See https://www.drupal.org/project/module_filter/issues/3412061
allow_failure: true
before_script:
# Provide some context on the test run. This is also done later, but the job will halt if the patching fails, so do it here too.
- vendor/bin/drush status
# Apply core patches
- cd $CI_PROJECT_DIR/$_WEB_ROOT
# Apply core patch from https://www.drupal.org/project/drupal/issues/2895388 which is on MR 3273 (for core 10.1) and MR 5496 for 10.2
# This adds the machine to the uninstall page and includes the small tableresponsive change from issue 3331975
# @todo Remove this when the above issue is committed and the new core version is used in this job step.
- curl https://git.drupalcode.org/project/drupal/-/merge_requests/5496.diff | patch -p1 --verbose
- cd $CI_PROJECT_DIR
- *module-filter-core-patches
......@@ -114,8 +114,8 @@
);
});
$show.change(() => {
show = $(this).val();
$show.change((event) => {
show = $(event.currentTarget).val();
Drupal.ModuleFilter.localStorage.setItem('updateStatus.show', show);
Drupal.ModuleFilter.winnow.filter();
});
......
......@@ -22,6 +22,7 @@ modules:
theme:
css/module_filter.modules.css: {}
dependencies:
- core/once
- module_filter/filter
modules.bare:
version: VERSION
......@@ -43,6 +44,7 @@ modules.uninstall:
js:
js/module_filter.modules_uninstall.js: {}
dependencies:
- core/once
- module_filter/filter
update.status:
version: VERSION
......@@ -52,10 +54,12 @@ update.status:
theme:
css/module_filter.update_status.css: {}
dependencies:
- core/once
- module_filter/filter
permissions:
version: VERSION
js:
js/module_filter.permissions.js: {}
dependencies:
- core/once
- module_filter/filter
......@@ -49,9 +49,13 @@ abstract class ModuleFilterJavascriptTestBase extends WebDriverTestBase {
parent::setUp();
// Create an administrator user with the required permissions.
// 'administer modules' is needed for admin/modules
// 'administer permissions' is needed for admin/people/permissions
// 'administer site configuration' is needed for admin/reports/updates.
$this->adminUser = $this->drupalCreateUser([
'administer modules',
'administer permissions',
'administer site configuration',
]);
$this->adminUser->set('name', 'Minnie the Admin')->save();
}
......
......@@ -27,13 +27,15 @@ class ModuleFilterJavascriptUninstallPageTest extends ModuleFilterJavascriptTest
// Enter 'red' as the filter and check that the Red Roses module is
// displayed but the other modules are not. This shows that filtering works
// on the module's internal machine name.
$page->fillField('edit-text', 'red');
$this->waitForNoText('Banana');
$assert->pageTextContains('Roses');
$assert->pageTextContains('Say it with flowers');
$assert->pageTextNotContains('Banana');
$assert->pageTextNotContains('Ridge');
// on the module's internal machine name. Available on Core 10 and above.
if (version_compare(\Drupal::VERSION, '10.0', '>=')) {
$page->fillField('edit-text', 'red');
$this->waitForNoText('Banana');
$assert->pageTextContains('Roses');
$assert->pageTextContains('Say it with flowers');
$assert->pageTextNotContains('Banana');
$assert->pageTextNotContains('Ridge');
}
// Enter 'nana' as the filter and check that the Yellow Banana module is
// displayed but the others modules are not. This shows that filtering works
......@@ -65,7 +67,9 @@ class ModuleFilterJavascriptUninstallPageTest extends ModuleFilterJavascriptTest
$page->fillField('edit-text', 'low');
$assert->waitForText('Roses');
$assert->pageTextContains('Roses');
$assert->pageTextContains('Banana');
if (version_compare(\Drupal::VERSION, '10.0', '>=')) {
$assert->pageTextContains('Banana');
}
$assert->pageTextNotContains('Ridge');
$assert->pageTextNotContains('Mountains of Virginia');
......
<?php
namespace Drupal\Tests\module_filter\FunctionalJavascript;
/**
* Tests the module update status report page.
*
* @group module_filter
*/
class ModuleFilterJavascriptUpdateStatusReportPageTest extends ModuleFilterJavascriptTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'module_filter',
'update',
];
/**
* Tests text filtering and radio buttons on the Updates Report page.
*/
public function testUpdateStatusPageFiltering() {
/** @var \Drupal\Tests\WebAssert $assert */
$assert = $this->assertSession();
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/reports/updates');
$page = $this->getSession()->getPage();
// Verify that all the modules used in this test are displayed by default.
// Test modules will not show on the update status page, so we use this
// modules dependencies instead.
$assert->pageTextContains('Drupal core');
$assert->pageTextContains('jQuery UI');
$assert->pageTextContains('jQuery UI Autocomplete');
$assert->pageTextContains('jQuery UI Menu');
// Ensure the text filter field exists.
$page->hasField('text');
// Enter 'jquery' as the filter and check that Drupal core is not shown but
// all the jQuery UI dependencies are. This shows that filtering works on
// the module displayed name and is not case-sensitive.
$page->fillField('text', 'jquery');
$this->waitForNoText('Drupal core');
$assert->pageTextNotContains('Drupal core');
$assert->pageTextContains('jQuery UI');
$assert->pageTextContains('jQuery UI Autocomplete');
$assert->pageTextContains('jQuery UI Menu');
// Enter 'toco' as the filter and check that the jQuery UI Autocomplete
// module is displayed but Drupal Core and Jquery UI Menu are not. This
// shows that the filter matches when entering partial words.
$page->fillField('text', 'toco');
$this->waitForNoText('jQuery UI Menu');
$assert->pageTextNotContains('Drupal core');
$assert->pageTextContains('jQuery UI Autocomplete');
$assert->pageTextNotContains('jQuery UI Menu');
// Clear the edit text field and verify that all the modules used in this
// test are once more displayed.
$page->fillField('text', '');
$assert->waitForText('Drupal core');
$assert->pageTextContains('Drupal core');
$assert->pageTextContains('jQuery UI');
$assert->pageTextContains('jQuery UI Autocomplete');
$assert->pageTextContains('jQuery UI Menu');
// Ensure the 'show' radio buttons field exists.
$page->hasField('show');
$show = $page->findField('show');
// Select 'updates' and check that the JQuery modules are not shown.
$show->selectOption('updates');
$this->waitForNoText('jquery');
// Reset back to all and check that jQuery UI is shown.
$show->selectOption('all');
$assert->waitForText('Drupal core');
$assert->pageTextContains('jQuery UI Autocomplete');
$assert->pageTextContains('jQuery UI Menu');
// Select 'unsupported' and check that jQuery is not shown.
$show->selectOption('unsupported');
$this->waitForNoText('jQuery');
$assert->pageTextNotContains('jQuery UI');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment