mirror of
https://github.com/openclaw/clawhub.git
synced 2026-08-14 08:52:21 +00:00
fix: order skills before plugins on homepage (#3316)
This commit is contained in:
@@ -83,6 +83,13 @@ describe("HomeListingSection", () => {
|
||||
const second = makeTrending("second", "Second Skill", 3, 8000);
|
||||
render(<HomeListingSection initialListing={initialTrending([first, second])} />);
|
||||
|
||||
const contentTypeButtons = screen
|
||||
.getByRole("group", { name: "Content type" })
|
||||
.querySelectorAll("button");
|
||||
expect(Array.from(contentTypeButtons, (button) => button.textContent)).toEqual([
|
||||
"Skills",
|
||||
"Plugins",
|
||||
]);
|
||||
expect(screen.getByRole("button", { name: "Skills" }).getAttribute("aria-pressed")).toBe(
|
||||
"true",
|
||||
);
|
||||
|
||||
@@ -144,8 +144,8 @@ describe("HomeListingSection", () => {
|
||||
.getByRole("group", { name: "Content type" })
|
||||
.querySelectorAll("button");
|
||||
expect(Array.from(contentTypeButtons, (button) => button.textContent)).toEqual([
|
||||
"Plugins",
|
||||
"Skills",
|
||||
"Plugins",
|
||||
]);
|
||||
expect(screen.getByRole("button", { name: "Plugins" }).getAttribute("aria-pressed")).toBe(
|
||||
"true",
|
||||
|
||||
@@ -793,16 +793,6 @@ export function HomeListingSection({ initialListing = null }: HomeListingSection
|
||||
role="group"
|
||||
aria-label="Content type"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
className={`home-v2-listing-kind-btn clawhub-segmented-btn oc-segmented-item${
|
||||
kind === "plugins" ? " is-active" : ""
|
||||
}`}
|
||||
aria-pressed={kind === "plugins"}
|
||||
onClick={() => handleKindChange("plugins")}
|
||||
>
|
||||
Plugins
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={`home-v2-listing-kind-btn clawhub-segmented-btn oc-segmented-item${
|
||||
@@ -813,6 +803,16 @@ export function HomeListingSection({ initialListing = null }: HomeListingSection
|
||||
>
|
||||
Skills
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={`home-v2-listing-kind-btn clawhub-segmented-btn oc-segmented-item${
|
||||
kind === "plugins" ? " is-active" : ""
|
||||
}`}
|
||||
aria-pressed={kind === "plugins"}
|
||||
onClick={() => handleKindChange("plugins")}
|
||||
>
|
||||
Plugins
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<span className="home-v2-listing-divider" aria-hidden="true" />
|
||||
|
||||
Reference in New Issue
Block a user