Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
c217e00f
Verified
Commit
c217e00f
authored
4 months ago
by
Pierre Rudloff
Browse files
Options
Downloads
Patches
Plain Diff
Add JS test
parent
3f6c8613
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/tests/Drupal/Nightwatch/Tests/ajaxGetParametersTest.js
+46
-0
46 additions, 0 deletions
core/tests/Drupal/Nightwatch/Tests/ajaxGetParametersTest.js
core/tests/Drupal/TestSite/TestSiteViewAjaxInstallTestScript.php
+30
-0
30 additions, 0 deletions
...sts/Drupal/TestSite/TestSiteViewAjaxInstallTestScript.php
with
76 additions
and
0 deletions
core/tests/Drupal/Nightwatch/Tests/ajaxGetParametersTest.js
0 → 100644
+
46
−
0
View file @
c217e00f
module
.
exports
=
{
'
@tags
'
:
[
'
core
'
,
'
ajax
'
],
before
(
browser
)
{
browser
.
drupalInstall
({
setupFile
:
'
core/tests/Drupal/TestSite/TestSiteViewAjaxInstallTestScript.php
'
,
installProfile
:
'
minimal
'
,
});
},
after
(
browser
)
{
browser
.
drupalUninstall
();
},
'
Test View AJAX GET parameters
'
:
(
browser
)
=>
{
browser
.
drupalLoginAsAdmin
(()
=>
{
browser
.
drupalRelativeURL
(
'
/admin/content?title=&type=All&status=All
'
)
.
waitForElementVisible
(
'
body
'
,
1000
)
.
captureNetworkRequests
((
requestParams
)
=>
{
if
(
requestParams
.
request
.
headers
[
'
X-Requested-With
'
]
===
'
XMLHttpRequest
'
)
{
const
searchParams
=
URL
.
parse
(
requestParams
.
request
.
url
,
).
searchParams
;
browser
.
assert
.
strictEqual
(
searchParams
.
getAll
(
'
title
'
).
length
,
1
,
'
Duplicate title parameter
'
,
);
browser
.
assert
.
strictEqual
(
searchParams
.
getAll
(
'
type
'
).
length
,
1
,
'
Duplicate type parameter
'
,
);
browser
.
assert
.
strictEqual
(
searchParams
.
getAll
(
'
status
'
).
length
,
1
,
'
Duplicate status parameter
'
,
);
}
})
.
click
(
'
#edit-submit-content
'
);
});
},
};
This diff is collapsed.
Click to expand it.
core/tests/Drupal/TestSite/TestSiteViewAjaxInstallTestScript.php
0 → 100644
+
30
−
0
View file @
c217e00f
<?php
declare
(
strict_types
=
1
);
namespace
Drupal\TestSite
;
use
Drupal\Core\Extension\ModuleInstallerInterface
;
/**
* Setup file used by ajaxGetParametersTest.js.
*
* @see \Drupal\KernelTests\Scripts\TestSiteApplicationTest
*/
class
TestSiteViewAjaxInstallTestScript
implements
TestSetupInterface
{
/**
* {@inheritdoc}
*/
public
function
setup
():
void
{
$module_installer
=
\Drupal
::
service
(
'module_installer'
);
assert
(
$module_installer
instanceof
ModuleInstallerInterface
);
$module_installer
->
install
([
'views'
,
'node'
]);
// Enable AJAX on the /admin/content View.
\Drupal
::
configFactory
()
->
getEditable
(
'views.view.content'
)
->
set
(
'display.default.display_options.use_ajax'
,
TRUE
)
->
save
();
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment