@decocms/apps-nuvemshop 7.77.0 → 7.77.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decocms/apps-nuvemshop",
|
|
3
|
-
"version": "7.77.
|
|
3
|
+
"version": "7.77.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Deco commerce app: Nuvemshop (Tiendanube) Storefront API integration",
|
|
6
6
|
"repository": {
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"lint:unused": "knip"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@decocms/blocks": "7.77.
|
|
34
|
-
"@decocms/apps-commerce": "7.77.
|
|
35
|
-
"@decocms/apps-website": "7.77.
|
|
33
|
+
"@decocms/blocks": "7.77.1",
|
|
34
|
+
"@decocms/apps-commerce": "7.77.1",
|
|
35
|
+
"@decocms/apps-website": "7.77.1"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"react": "^19.0.0"
|
|
@@ -72,6 +72,15 @@ describe("productListingPage", () => {
|
|
|
72
72
|
expect(plp!.seo).toMatchObject({ title: "Camisas", canonical: `${SITE}/camisas` });
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
+
it("lists the category's default sort first, so a UI without ?sort_by= shows the real order", async () => {
|
|
76
|
+
const plp = await productListingPage({ __pageUrl: `${SITE}/camisas/` });
|
|
77
|
+
expect(plp!.sortOptions[0].value).toBe("created-descending");
|
|
78
|
+
configureNuvemshop({ storeId: "8336778", defaultSort: "price-ascending" });
|
|
79
|
+
const cheap = await productListingPage({ __pageUrl: `${SITE}/camisas/?x=1` });
|
|
80
|
+
expect(cheap!.sortOptions[0].value).toBe("price-ascending");
|
|
81
|
+
expect(cheap!.sortOptions).toHaveLength(plp!.sortOptions.length);
|
|
82
|
+
});
|
|
83
|
+
|
|
75
84
|
it("asks the API for best-selling order (the only sort it must do itself)", async () => {
|
|
76
85
|
await productListingPage({ __pageUrl: `${SITE}/camisas/?sort_by=best-selling` });
|
|
77
86
|
expect(lastUrl("/products").searchParams.get("sort_by")).toBe("best-selling");
|
|
@@ -77,6 +77,11 @@ export default async function productListingPage(
|
|
|
77
77
|
"@type": "ProductListingPage",
|
|
78
78
|
...listing,
|
|
79
79
|
...withPageType(listing.pageInfo, leaf.parent ? "SubCategory" : "Category"),
|
|
80
|
+
// Default sort first: a sort UI with no ?sort_by= falls back to the first option.
|
|
81
|
+
sortOptions: [
|
|
82
|
+
...listing.sortOptions.filter((o) => o.value === defaultSort),
|
|
83
|
+
...listing.sortOptions.filter((o) => o.value !== defaultSort),
|
|
84
|
+
],
|
|
80
85
|
breadcrumb: toBreadcrumbList(leaf, categories, origin),
|
|
81
86
|
seo: {
|
|
82
87
|
title: leaf.seo_title || leaf.name,
|