-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into cleanup-3.20.25
- Loading branch information
Showing
29 changed files
with
611 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"saleor-dashboard": patch | ||
--- | ||
|
||
You can now edit note in order details. Notes in order details now show id of note, id of related note and type of note "added" or "updated" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"saleor-dashboard": patch | ||
--- | ||
|
||
You can now open datagrid list item in new tab using cmd/ctrl button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"saleor-dashboard": patch | ||
--- | ||
|
||
After creating a new collection, you should see a list of assigned channels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"saleor-dashboard": patch | ||
--- | ||
|
||
Activates list items on the welcome page no longer implies that they are clickable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"saleor-dashboard": patch | ||
--- | ||
|
||
Editor.js no more cause error during saving |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { OrderEventFragment } from "@dashboard/graphql/types.generated"; | ||
import Wrapper from "@test/wrapper"; | ||
import { render, screen } from "@testing-library/react"; | ||
import { act, render, screen } from "@testing-library/react"; | ||
import userEvent from "@testing-library/user-event"; | ||
import React from "react"; | ||
|
||
import TimelineNote from "./TimelineNote"; | ||
|
@@ -142,4 +143,85 @@ describe("TimelineNote", () => { | |
expect(initials).toBeNull(); | ||
expect(avatar).toBeInTheDocument(); | ||
}); | ||
|
||
it("renders note id and refer id", () => { | ||
// Arrange | ||
const noteId = "T3JkZXJFdmVudDozNDM3"; | ||
const noteRelatedId = "T3JkZXJFdmVudDozNDQx"; | ||
const mockedUser = { | ||
avatar: null, | ||
id: "1", | ||
email: "[email protected]", | ||
firstName: "Test", | ||
lastName: "User", | ||
__typename: "User", | ||
} satisfies OrderEventFragment["user"]; | ||
|
||
// Act | ||
render( | ||
<TimelineNote | ||
app={null} | ||
user={mockedUser} | ||
date={wrapperFriendlyDate} | ||
message="Note" | ||
hasPlainDate={false} | ||
id={noteId} | ||
relatedId={noteRelatedId} | ||
/>, | ||
{ wrapper: Wrapper }, | ||
); | ||
|
||
// Assert | ||
expect(screen.getByText("Test User")).toBeInTheDocument(); | ||
expect(screen.getByText("Note")).toBeInTheDocument(); | ||
expect(screen.getByText("TU")).toBeInTheDocument(); | ||
expect(screen.getByText("a few seconds ago")).toBeInTheDocument(); | ||
expect(screen.getByText(`Note id: ${noteId}`)).toBeInTheDocument(); | ||
expect(screen.getByText(new RegExp(noteRelatedId))).toBeInTheDocument(); | ||
}); | ||
|
||
it("should edit note", async () => { | ||
// Arrange | ||
const noteId = "T3JkZXJFdmVudDozNDM3"; | ||
const noteRelatedId = "T3JkZXJFdmVudDozNDQx"; | ||
const onNoteUpdate = jest.fn(); | ||
const onNoteUpdateLoading = false; | ||
const mockedUser = { | ||
avatar: null, | ||
id: "1", | ||
email: "[email protected]", | ||
firstName: "Test", | ||
lastName: "User", | ||
__typename: "User", | ||
} satisfies OrderEventFragment["user"]; | ||
|
||
render( | ||
<TimelineNote | ||
app={null} | ||
user={mockedUser} | ||
date={wrapperFriendlyDate} | ||
message="Note" | ||
hasPlainDate={false} | ||
id={noteId} | ||
relatedId={noteRelatedId} | ||
onNoteUpdate={onNoteUpdate} | ||
onNoteUpdateLoading={onNoteUpdateLoading} | ||
/>, | ||
{ wrapper: Wrapper }, | ||
); | ||
|
||
// Act | ||
await act(async () => { | ||
await userEvent.click(screen.getByTestId("edit-note")); | ||
}); | ||
|
||
await act(async () => { | ||
await userEvent.clear(screen.getByRole("textbox")); | ||
await userEvent.type(screen.getByRole("textbox"), "New note"); | ||
await userEvent.click(screen.getByRole("button", { name: /save/i })); | ||
}); | ||
|
||
// Assert | ||
expect(onNoteUpdate).toHaveBeenCalledWith(noteId, "New note"); | ||
}); | ||
}); |
Oops, something went wrong.