Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
Engineering Digital Service
Metabase
Commits
75d24981
Unverified
Commit
75d24981
authored
4 months ago
by
Raphael Krut-Landau
Committed by
GitHub
4 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Ensure that correct error messages show up in the Edit user modal (#48966)
parent
7ffdac92
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
e2e/test/scenarios/admin-2/people.cy.spec.js
+12
-4
12 additions, 4 deletions
e2e/test/scenarios/admin-2/people.cy.spec.js
frontend/src/metabase/redux/user.ts
+2
-1
2 additions, 1 deletion
frontend/src/metabase/redux/user.ts
with
14 additions
and
5 deletions
e2e/test/scenarios/admin-2/people.cy.spec.js
+
12
−
4
View file @
75d24981
...
...
@@ -255,9 +255,17 @@ describe("scenarios > admin > people", () => {
showUserOptions
(
normalUserName
);
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy
.
findByText
(
"
Edit user
"
).
click
();
cy
.
findByDisplayValue
(
normal
.
first_name
).
click
().
clear
().
type
(
NEW_NAME
);
clickButton
(
"
Update
"
);
modal
().
within
(()
=>
{
cy
.
log
(
"
Should display error messages (metabase#46449)
"
);
cy
.
findByLabelText
(
"
First name
"
).
click
().
clear
().
type
(
"
"
);
clickButton
(
"
Update
"
);
cy
.
findByText
(
/non-blank string./
).
should
(
"
exist
"
);
cy
.
findByLabelText
(
"
First name
"
).
click
().
clear
().
type
(
NEW_NAME
);
clickButton
(
"
Update
"
,
{
timeout
:
4000
});
});
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy
.
findByText
(
NEW_FULL_NAME
);
cy
.
location
().
should
(
loc
=>
expect
(
loc
.
pathname
).
to
.
eq
(
"
/admin/people
"
));
...
...
@@ -872,8 +880,8 @@ function showUserOptions(full_name) {
});
}
function
clickButton
(
button_name
)
{
cy
.
button
(
button_name
).
should
(
"
not.be.disabled
"
).
click
();
function
clickButton
(
button_name
,
opts
=
{}
)
{
cy
.
button
(
button_name
,
opts
).
should
(
"
not.be.disabled
"
).
click
();
}
function
assertTableRowsCount
(
length
)
{
...
...
This diff is collapsed.
Click to expand it.
frontend/src/metabase/redux/user.ts
+
2
−
1
View file @
75d24981
...
...
@@ -43,7 +43,8 @@ export const currentUser = createReducer<User | null>(null, builder => {
return
state
;
})
.
addCase
(
Users
.
actionTypes
.
UPDATE
,
(
state
,
{
payload
})
=>
{
const
isCurrentUserUpdated
=
state
?.
id
===
payload
.
user
.
id
;
const
isCurrentUserUpdated
=
payload
.
user
&&
state
?.
id
===
payload
.
user
.
id
;
if
(
isCurrentUserUpdated
)
{
return
{
...
state
,
...
...
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