Skip to content

fix(site): Fix template icon field validation #7394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix stories
  • Loading branch information
BrunoQuaresma committed May 4, 2023
commit da6c6a5cb98550b88e81e4a15b3186f136e65ee3
15 changes: 4 additions & 11 deletions site/src/components/CreateUserForm/CreateUserForm.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { action } from "@storybook/addon-actions"
import { Story } from "@storybook/react"
import { CreateUserForm, CreateUserFormProps } from "./CreateUserForm"
import { mockApiError } from "testHelpers/entities"

export default {
title: "components/CreateUserForm",
Expand All @@ -18,22 +19,14 @@ Ready.args = {
isLoading: false,
}

export const UnknownError = Template.bind({})
UnknownError.args = {
onCancel: action("cancel"),
onSubmit: action("submit"),
isLoading: false,
error: "Something went wrong",
}

export const FormError = Template.bind({})
FormError.args = {
onCancel: action("cancel"),
onSubmit: action("submit"),
isLoading: false,
formErrors: {
username: "Username taken",
},
error: mockApiError({
validations: [{ field: "username", detail: "Username taken" }],
}),
}

export const Loading = Template.bind({})
Expand Down
21 changes: 9 additions & 12 deletions site/src/pages/UsersPage/UsersPageView.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
MockUser,
MockUser2,
MockAssignableSiteRoles,
mockApiError,
} from "testHelpers/entities"
import { UsersPageView, UsersPageViewProps } from "./UsersPageView"

Expand Down Expand Up @@ -42,17 +43,13 @@ EmptyPage.args = { users: [], isNonInitialPage: true }
export const Error = Template.bind({})
Error.args = {
users: undefined,
error: {
response: {
data: {
message: "Invalid user search query.",
validations: [
{
field: "status",
detail: `Query param "status" has invalid value: "inactive" is not a valid user status`,
},
],
error: mockApiError({
message: "Invalid user search query.",
validations: [
{
field: "status",
detail: `Query param "status" has invalid value: "inactive" is not a valid user status`,
},
},
},
],
}),
}