feat(medusa): Apply query transformers to Collection and CustomerGroups (#1667)

This commit is contained in:
Adrien de Peretti
2022-07-02 13:01:52 +02:00
committed by GitHub
parent fee0f88a62
commit e53c06eab8
21 changed files with 200 additions and 206 deletions

View File

@@ -189,20 +189,20 @@ Object {
"collections": Array [
Object {
"created_at": Any<String>,
"handle": "test-collection",
"id": "test-collection",
"handle": "test-collection2",
"id": "test-collection2",
"products": Array [
Object {
"collection_id": "test-collection",
"collection_id": "test-collection2",
"created_at": Any<String>,
"deleted_at": null,
"description": "test-product-description",
"discountable": true,
"external_id": null,
"handle": "test-product",
"handle": "test-product_filtering_2",
"height": null,
"hs_code": null,
"id": "test-product",
"id": "test-product_filtering_2",
"is_giftcard": false,
"length": null,
"material": null,
@@ -210,44 +210,17 @@ Object {
"mid_code": null,
"origin_country": null,
"profile_id": StringMatching /\\^sp_\\*/,
"status": "draft",
"status": "published",
"subtitle": null,
"thumbnail": null,
"title": "Test product",
"type_id": "test-type",
"updated_at": Any<String>,
"weight": null,
"width": null,
},
Object {
"collection_id": "test-collection",
"created_at": Any<String>,
"deleted_at": null,
"description": "test-product-description1",
"discountable": true,
"external_id": null,
"handle": "test-product1",
"height": null,
"hs_code": null,
"id": "test-product1",
"is_giftcard": false,
"length": null,
"material": null,
"metadata": null,
"mid_code": null,
"origin_country": null,
"profile_id": StringMatching /\\^sp_\\*/,
"status": "draft",
"subtitle": null,
"thumbnail": null,
"title": "Test product1",
"title": "Test product filtering 2",
"type_id": "test-type",
"updated_at": Any<String>,
"weight": null,
"width": null,
},
],
"title": "Test collection",
"title": "Test collection 2",
"updated_at": Any<String>,
},
Object {
@@ -315,20 +288,20 @@ Object {
},
Object {
"created_at": Any<String>,
"handle": "test-collection2",
"id": "test-collection2",
"handle": "test-collection",
"id": "test-collection",
"products": Array [
Object {
"collection_id": "test-collection2",
"collection_id": "test-collection",
"created_at": Any<String>,
"deleted_at": null,
"description": "test-product-description",
"discountable": true,
"external_id": null,
"handle": "test-product_filtering_2",
"handle": "test-product",
"height": null,
"hs_code": null,
"id": "test-product_filtering_2",
"id": "test-product",
"is_giftcard": false,
"length": null,
"material": null,
@@ -336,17 +309,44 @@ Object {
"mid_code": null,
"origin_country": null,
"profile_id": StringMatching /\\^sp_\\*/,
"status": "published",
"status": "draft",
"subtitle": null,
"thumbnail": null,
"title": "Test product filtering 2",
"title": "Test product",
"type_id": "test-type",
"updated_at": Any<String>,
"weight": null,
"width": null,
},
Object {
"collection_id": "test-collection",
"created_at": Any<String>,
"deleted_at": null,
"description": "test-product-description1",
"discountable": true,
"external_id": null,
"handle": "test-product1",
"height": null,
"hs_code": null,
"id": "test-product1",
"is_giftcard": false,
"length": null,
"material": null,
"metadata": null,
"mid_code": null,
"origin_country": null,
"profile_id": StringMatching /\\^sp_\\*/,
"status": "draft",
"subtitle": null,
"thumbnail": null,
"title": "Test product1",
"type_id": "test-type",
"updated_at": Any<String>,
"weight": null,
"width": null,
},
],
"title": "Test collection 2",
"title": "Test collection",
"updated_at": Any<String>,
},
],

View File

@@ -176,20 +176,14 @@ describe("/admin/collections", () => {
expect(response.data).toMatchSnapshot({
collections: [
{
id: "test-collection",
handle: "test-collection",
title: "Test collection",
id: "test-collection2",
handle: "test-collection2",
title: "Test collection 2",
created_at: expect.any(String),
updated_at: expect.any(String),
products: [
{
collection_id: "test-collection",
created_at: expect.any(String),
updated_at: expect.any(String),
profile_id: expect.stringMatching(/^sp_*/),
},
{
collection_id: "test-collection",
collection_id: "test-collection2",
created_at: expect.any(String),
updated_at: expect.any(String),
profile_id: expect.stringMatching(/^sp_*/),
@@ -218,14 +212,20 @@ describe("/admin/collections", () => {
],
},
{
id: "test-collection2",
handle: "test-collection2",
title: "Test collection 2",
id: "test-collection",
handle: "test-collection",
title: "Test collection",
created_at: expect.any(String),
updated_at: expect.any(String),
products: [
{
collection_id: "test-collection2",
collection_id: "test-collection",
created_at: expect.any(String),
updated_at: expect.any(String),
profile_id: expect.stringMatching(/^sp_*/),
},
{
collection_id: "test-collection",
created_at: expect.any(String),
updated_at: expect.any(String),
profile_id: expect.stringMatching(/^sp_*/),