Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gin-3399600
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
gin-3399600
Commits
6dcd97cf
Commit
6dcd97cf
authored
2 years ago
by
Sascha Eggenberger
Browse files
Options
Downloads
Patches
Plain Diff
Update Functional tests
parent
fc1825ba
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/src/Functional/GinTest.php
+13
-9
13 additions, 9 deletions
tests/src/Functional/GinTest.php
with
13 additions
and
9 deletions
tests/src/Functional/GinTest.php
+
13
−
9
View file @
6dcd97cf
...
...
@@ -20,7 +20,7 @@ class GinTest extends BrowserTestBase {
*
* @var string[]
*/
p
ublic
static
$modules
=
[
'shortcut'
];
p
rotected
static
$modules
=
[
'shortcut'
];
/**
* {@inheritdoc}
...
...
@@ -106,18 +106,20 @@ class GinTest extends BrowserTestBase {
$user1
=
$this
->
createUser
();
$this
->
drupalLogin
(
$user1
);
// Change something on the logged in user form.
$this
->
drupalGet
(
$user1
->
toUrl
(
'edit-form'
));
$this
->
assertSession
()
->
pageTextContains
(
'"darkmode":"0"'
);
$this
->
assertStringContainsString
(
'"darkmode":"0"'
,
$this
->
drupalGet
(
$user1
->
toUrl
(
'edit-form'
))
)
;
$this
->
submitForm
([
'enable_user_settings'
=>
TRUE
,
'enable_darkmode'
=>
'1'
,
],
'Save'
);
$this
->
assertS
ession
()
->
pageText
Contains
(
'"darkmode":"1"'
);
$this
->
assertS
tring
Contains
String
(
'"darkmode":"1"'
,
$this
->
drupalGet
(
$user1
->
toUrl
(
'edit-form'
))
);
// Login as admin.
$this
->
drupalLogin
(
$this
->
rootUser
);
$this
->
assertSession
()
->
pageTextContains
(
'"darkmode":"0"'
);
$this
->
assertStringContainsString
(
'"darkmode":"0"'
,
$this
->
drupalGet
(
'edit-form'
));
// Change something on user1 edit form.
$this
->
drupalGet
(
$user1
->
toUrl
(
'edit-form'
));
$this
->
submitForm
([
...
...
@@ -127,13 +129,15 @@ class GinTest extends BrowserTestBase {
],
'Save'
);
// Check logged-in's user is not affected.
$this
->
assertSession
()
->
pageTextContains
(
'"highcontrastmode":false'
);
$this
->
assertSession
()
->
pageTextContains
(
'"darkmode":"0"'
);
$loggedInUserResponse
=
$this
->
drupalGet
(
'edit-form'
);
$this
->
assertStringContainsString
(
'"highcontrastmode":false'
,
$loggedInUserResponse
);
$this
->
assertStringContainsString
(
'"darkmode":"0"'
,
$loggedInUserResponse
);
// Check settings of user1.
$this
->
drupalLogin
(
$user1
);
$this
->
assertSession
()
->
pageTextContains
(
'"highcontrastmode":true'
);
$this
->
assertSession
()
->
pageTextContains
(
'"darkmode":"1"'
);
$rootUserResponse
=
$this
->
drupalGet
(
$user1
->
toUrl
(
'edit-form'
));
$this
->
assertStringContainsString
(
'"highcontrastmode":true'
,
$rootUserResponse
);
$this
->
assertStringContainsString
(
'"darkmode":"1"'
,
$rootUserResponse
);
}
}
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