Repository: shopware/frontends
Pull request #1027 (2024-06-19 07:05:13)

feat: add composable tests
### Description

Added `useCategorySearch` and `useCmsElementProductBox` tests

### Type of change

<!-- Comment out the type of change your PR is making -->

<!-- Bug fix (non-breaking change that fixes an issue) -->
<!-- New feature (non-breaking change which adds functionality) -->
<!-- Breaking change (fix or feature that would cause existing functionality to not work as expected) -->

### ToDo's

<!-- Add the todo's that need to be done before merge -->
<!-- Remember to run `pnpm run changeset` and describe your change (plus potential migration guide/important notes) to your pull request. -->

<!-- - [ ] Changeset file provided [read more](https://github.com/shopware/frontends/blob/main/CONTRIBUTION.md#changelog-preparation) -->
<!-- - [ ] Documentation added/updated -->
<!-- - [ ] Unit-Tests added/updated -->
<!-- - [ ] E2E-Tests added/updated -->
<!-- - [ ] Related Issue updated -->

### Screenshots (if applicable)

<!-- Please attach any relevant screenshots or images to help explain your changes. -->

### Additional context

<!-- Add any other context about the pull request here. -->


vercel[bot]: [vc]: #GlZ+ea2ckN5kCrdTi5ksZzOMr5KHPoH07gQidgCUTlA=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJzaG9wd2FyZS1mcm9udGVuZHMtZG9jcyIsInJvb3REaXJlY3RvcnkiOiJhcHBzL2RvY3MvIiwiaW5zcGVjdG9yVXJsIjoiaHR0cHM6Ly92ZXJjZWwuY29tL3Nob3B3YXJlLWZyb250ZW5kcy9zaG9wd2FyZS1mcm9udGVuZHMtZG9jcy9GQnp5ZHlncDNtM2JkQjlyZnlYRTJwb3Z5V1J0IiwicHJldmlld1VybCI6InNob3B3YXJlLWZyb250ZW5kcy1kb2NzLWdpdC1mZWF0LWNvbXAtN2E5OGIyLXNob3B3YXJlLWZyb250ZW5kcy52ZXJjZWwuYXBwIiwibmV4dENvbW1pdFN0YXR1cyI6IlBFTkRJTkcifSx7Im5hbWUiOiJmcm9udGVuZHMtZGVtbyIsInJvb3REaXJlY3RvcnkiOiJ0ZW1wbGF0ZXMvdnVlLWRlbW8tc3RvcmUiLCJpbnNwZWN0b3JVcmwiOiJodHRwczovL3ZlcmNlbC5jb20vc2hvcHdhcmUtZnJvbnRlbmRzL2Zyb250ZW5kcy1kZW1vL0g5VHBEVFdWa3Q3a0xtcmp1Mlk5OTN4dHhEN0YiLCJwcmV2aWV3VXJsIjoiZnJvbnRlbmRzLWRlbW8tZ2l0LWZlYXQtY29tcG9zYWJsZS10ZXN0cy1zaG9wd2FyZS1mcm9udGVuZHMudmVyY2VsLmFwcCIsIm5leHRDb21taXRTdGF0dXMiOiJQRU5ESU5HIn1dfQ==
**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Updated (UTC) |
| :--- | :----- | :------ | :------ |
| **frontends-demo** | 🔄 Building ([Inspect](https://vercel.com/shopware-frontends/frontends-demo/H9TpDTWVkt7kLmrju2Y993xtxD7F)) | [Visit Preview](https://frontends-demo-git-feat-composable-tests-shopware-frontends.vercel.app) | Jun 19, 2024 7:05am |
| **shopware-frontends-docs** | 🔄 Building ([Inspect](https://vercel.com/shopware-frontends/shopware-frontends-docs/FBzydygp3m3bdB9rfyXE2povyWRt)) | [Visit Preview](https://shopware-frontends-docs-git-feat-comp-7a98b2-shopware-frontends.vercel.app) | Jun 19, 2024 7:05am |



codspeed-hq[bot]: ## [CodSpeed Performance Report](https://codspeed.io/shopware/frontends/branches/feat/composable-tests)

### Merging #1027 will **not alter performance**

<sub>Comparing <code>feat/composable-tests</code> (c3a2723) with <code>main</code> (0027cdd)</sub>



### Summary

`✅ 9` untouched benchmarks






Patch:
diff --git a/.changeset/ten-icons-agree.md b/.changeset/ten-icons-agree.md
new file mode 100644
index 00000000..37badeeb
--- /dev/null
+++ b/.changeset/ten-icons-agree.md
@@ -0,0 +1,5 @@
+---
+"@shopware-pwa/composables-next": minor
+---
+
+Added `useCategorySearch` and `useCmsElementProductBox` tests
diff --git a/packages/composables/src/mocks/CmsProductBox.ts b/packages/composables/src/mocks/CmsProductBox.ts
new file mode 100644
index 00000000..8d024f6b
--- /dev/null
+++ b/packages/composables/src/mocks/CmsProductBox.ts
@@ -0,0 +1,377 @@
+const CmsProductBox = {
+  versionId: "0fa91ce3e96a4bc2be4bd9ce752c3425",
+  translated: {
+    config: {
+      product: {
+        value: "65666d2629744f65b981cc6263d3ef0a",
+        source: "static",
+      },
+      boxLayout: {
+        value: "standard",
+        source: "static",
+      },
+      displayMode: {
+        value: "standard",
+        source: "static",
+      },
+      verticalAlign: {
+        value: null,
+        source: "static",
+      },
+    },
+    customFields: {},
+  },
+  createdAt: "2020-08-06T06:26:23.933+00:00",
+  updatedAt: "2024-04-03T07:25:20.056+00:00",
+  type: "product-box",
+  slot: "center",
+  block: null,
+  blockId: "75e7d6159c194c27909bbbf6df001ae1",
+  config: {
+    product: {
+      value: "65666d2629744f65b981cc6263d3ef0a",
+      source: "static",
+    },
+    boxLayout: {
+      value: "standard",
+      source: "static",
+    },
+    displayMode: {
+      value: "standard",
+      source: "static",
+    },
+    verticalAlign: {
+      value: null,
+      source: "static",
+    },
+  },
+  fieldConfig: [
+    {
+      name: "product",
+      source: "static",
+      value: "65666d2629744f65b981cc6263d3ef0a",
+      apiAlias: "cms_data_resolver_field_config",
+    },
+    {
+      name: "boxLayout",
+      source: "static",
+      value: "standard",
+      apiAlias: "cms_data_resolver_field_config",
+    },
+    {
+      name: "displayMode",
+      source: "static",
+      value: "standard",
+      apiAlias: "cms_data_resolver_field_config",
+    },
+    {
+      name: "verticalAlign",
+      source: "static",
+      value: null,
+      apiAlias: "cms_data_resolver_field_config",
+    },
+  ],
+  translations: null,
+  data: {
+    productId: "65666d2629744f65b981cc6263d3ef0a",
+    product: {
+      extensions: {
+        foreignKeys: {
+          swagCustomizedProductsTemplateId: null,
+          swagCustomizedProductsTemplateVersionId:
+            "0fa91ce3e96a4bc2be4bd9ce752c3425",
+          apiAlias: "product_foreign_keys_extension",
+        },
+        search: {
+          extensions: [],
+          _uniqueIdentifier: null,
+          translated: [],
+          productNumber: "943280",
+          autoIncrement: 126,
+        },
+      },
+      versionId: "0fa91ce3e96a4bc2be4bd9ce752c3425",
+      translated: {
+        metaDescription: null,
+        name: "Smoking Board Cedar Wood ",
+        keywords: null,
+        description:
+          "\u003Cp\u003E\u003C/p\u003E\u003Ch5\u003EHighlights\u003C/h5\u003E\u003Cul\u003E\u003Cli\u003E30 x 14 cm, set of 10\u003C/li\u003E\u003Cli\u003ECanadian cedarwood\u003C/li\u003E\u003Cli\u003EMoisture content below 14%\u003C/li\u003E\u003Cli\u003EImportant: leave to soak in water for 1 hour before use\u003C/li\u003E\u003Cli\u003E5 planks each with a smooth and rough surface\u003C/li\u003E\u003Cli\u003ECleaning by hand\u003C/li\u003E\u003Cli\u003EContents 10 smoking boards\u003C/li\u003E\u003C/ul\u003E\u003Cdiv\u003E\u003Ca href=\u0022124c71d524604ccbad6042edce3ac799/detail/018bd828d69f72dba59567a17c432eae#\u0022 target=\u0022_self\u0022 rel=\u0022noreferrer noopener\u0022\u003ETest Product Link\u003C/a\u003E\u003Cbr /\u003E\u003C/div\u003E\u003Cdiv\u003E\u003Ca target=\u0022_self\u0022 href=\u0022https://www.shopware.com/en/\u0022 rel=\u0022noreferrer noopener\u0022\u003ETest URL link\u003C/a\u003E\u003C/div\u003E\u003Cdiv\u003E\u003Ca target=\u0022_self\u0022 href=\u0022124c71d524604ccbad6042edce3ac799/navigation/da5db02a783e467cae47e8d64c9f09a1#\u0022 rel=\u0022noreferrer noopener\u0022\u003ETest Category Link\u003C/a\u003E\u003C/div\u003E\u003Cdiv\u003E\u003Ca target=\u0022_self\u0022 href=\u0022mailto:shopware@shopware.com\u0022 rel=\u0022noreferrer noopener\u0022\u003ETest Email\u003C/a\u003E\u003Cbr /\u003E\u003C/div\u003E\u003Cdiv\u003E\u003Ca target=\u0022_self\u0022 href=\u0022tel:343434343\u0022 rel=\u0022noreferrer noopener\u0022\u003ETest Phone\u003C/a\u003E\u003Cbr /\u003E\u003C/div\u003E",
+        metaTitle: null,
+        packUnit: null,
+        packUnitPlural: null,
+        customFields: {},
+      },
+      createdAt: "2020-08-06T06:26:45.454+00:00",
+      updatedAt: "2024-02-16T13:11:56.389+00:00",
+      parentId: null,
+      childCount: 0,
+      taxId: "94f1e03140d24698a894320e258e6d83",
+      manufacturerId: "05cd4e976df14c4d90e351f345ff5aa3",
+      unitId: null,
+      active: true,
+      displayGroup: "6ee9c82b6cdb6583cfa18aef4bff98a9",
+      manufacturerNumber: null,
+      ean: null,
+      sales: 8,
+      productNumber: "943280",
+      stock: 49484,
+      availableStock: 49484,
+      available: true,
+      deliveryTimeId: "0caaf7f6131142f6b1fa81f3e3f6c0fb",
+      deliveryTime: {
+        translated: {
+          name: "1-3 days",
+          customFields: {},
+        },
+        createdAt: "2020-08-06T06:26:54.178+00:00",
+        updatedAt: "2020-08-06T06:26:54.182+00:00",
+        name: "1-3 days",
+        min: 1,
+        max: 3,
+        unit: "day",
+        customFields: null,
+        id: "0caaf7f6131142f6b1fa81f3e3f6c0fb",
+        apiAlias: "delivery_time",
+      },
+      restockTime: 1,
+      isCloseout: false,
+      purchaseSteps: 1,
+      maxPurchase: 5,
+      minPurchase: 1,
+      purchaseUnit: null,
+      referenceUnit: null,
+      shippingFree: false,
+      markAsTopseller: null,
+      weight: null,
+      width: 300,
+      height: 140,
+      length: 8,
+      releaseDate: null,
+      categoryTree: [
+        "525abe8981214bd2ba94fd33942333ec",
+        "bda4b60e845240b2b9d6b60e71196e14",
+        "79f30922410344cca284b80be225cbfe",
+        "6bb2662482fe42fb90129f32cdd645bb",
+      ],
+      streamIds: [
+        "1318833f46df457981763b94179d9ef0",
+        "5675448d6b3a4dd2a659d31a3dde74da",
+        "e8a363db4d1542dca933ffde1ebeace4",
+      ],
+      optionIds: null,
+      propertyIds: [
+        "88592e7788484990b5a7389751eafebe",
+        "dbc078734b5b49a9a05a07646ccb8cdc",
+      ],
+      name: "Smoking Board Cedar Wood ",
+      keywords: null,
+      description:
+        "\u003Cp\u003E\u003C/p\u003E\u003Ch5\u003EHighlights\u003C/h5\u003E\u003Cul\u003E\u003Cli\u003E30 x 14 cm, set of 10\u003C/li\u003E\u003Cli\u003ECanadian cedarwood\u003C/li\u003E\u003Cli\u003EMoisture content below 14%\u003C/li\u003E\u003Cli\u003EImportant: leave to soak in water for 1 hour before use\u003C/li\u003E\u003Cli\u003E5 planks each with a smooth and rough surface\u003C/li\u003E\u003Cli\u003ECleaning by hand\u003C/li\u003E\u003Cli\u003EContents 10 smoking boards\u003C/li\u003E\u003C/ul\u003E\u003Cdiv\u003E\u003Ca href=\u0022124c71d524604ccbad6042edce3ac799/detail/018bd828d69f72dba59567a17c432eae#\u0022 target=\u0022_self\u0022 rel=\u0022noreferrer noopener\u0022\u003ETest Product Link\u003C/a\u003E\u003Cbr /\u003E\u003C/div\u003E\u003Cdiv\u003E\u003Ca target=\u0022_self\u0022 href=\u0022https://www.shopware.com/en/\u0022 rel=\u0022noreferrer noopener\u0022\u003ETest URL link\u003C/a\u003E\u003C/div\u003E\u003Cdiv\u003E\u003Ca target=\u0022_self\u0022 href=\u0022124c71d524604ccbad6042edce3ac799/navigation/da5db02a783e467cae47e8d64c9f09a1#\u0022 rel=\u0022noreferrer noopener\u0022\u003ETest Category Link\u003C/a\u003E\u003C/div\u003E\u003Cdiv\u003E\u003Ca target=\u0022_self\u0022 href=\u0022mailto:shopware@shopware.com\u0022 rel=\u0022noreferrer noopener\u0022\u003ETest Email\u003C/a\u003E\u003Cbr /\u003E\u003C/div\u003E\u003Cdiv\u003E\u003Ca target=\u0022_self\u0022 href=\u0022tel:343434343\u0022 rel=\u0022noreferrer noopener\u0022\u003ETest Phone\u003C/a\u003E\u003Cbr /\u003E\u003C/div\u003E",
+      metaDescription: null,
+      metaTitle: null,
+      packUnit: null,
+      packUnitPlural: null,
+      tax: {
+        translated: [],
+        createdAt: "2020-08-06T06:23:45.421+00:00",
+        updatedAt: "2020-08-06T06:26:46.302+00:00",
+        taxRate: 7,
+        name: "7%",
+        position: 0,
+        customFields: null,
+        id: "94f1e03140d24698a894320e258e6d83",
+        apiAlias: "tax",
+      },
+      manufacturer: {
+        versionId: "0fa91ce3e96a4bc2be4bd9ce752c3425",
+        translated: {
+          name: "Springlane",
+          description:
+            "We fuel people\u2019s passion for cooking.Good food is our passion. Our products and brands are therefore aimed at foodies and BBQ enthusiasts. With our food blogs, we inspire and inform millions of users every week about cooking and grilling.Springlane is a founder-managed, fully integrated company with online direct sales in Germany, Austria, Switzerland, Italy, France, Spain, the Netherlands and the UK. At its D\u00fcsseldorf location, Springlane currently employs 90 people including engineers, designers, software developers, chefs, bloggers and digital marketing experts.We want to continue to grow strongly and play an important role in the lives of our customers and in our industry! That\u0027s exactly what we get up for every morning.",
+          customFields: {},
+        },
+        createdAt: "2020-08-06T06:26:30.586+00:00",
+        updatedAt: null,
+        mediaId: "1efd8cb1fe164e4f8d56f0ff5ed954fa",
+        name: "Springlane",
+        link: "http://www.springlane.de",
+        description:
+          "We fuel people\u2019s passion for cooking.Good food is our passion. Our products and brands are therefore aimed at foodies and BBQ enthusiasts. With our food blogs, we inspire and inform millions of users every week about cooking and grilling.Springlane is a founder-managed, fully integrated company with online direct sales in Germany, Austria, Switzerland, Italy, France, Spain, the Netherlands and the UK. At its D\u00fcsseldorf location, Springlane currently employs 90 people including engineers, designers, software developers, chefs, bloggers and digital marketing experts.We want to continue to grow strongly and play an important role in the lives of our customers and in our industry! That\u0027s exactly what we get up for every morning.",
+        media: null,
+        translations: null,
+        customFields: null,
+        id: "05cd4e976df14c4d90e351f345ff5aa3",
+        apiAlias: "product_manufacturer",
+      },
+      unit: null,
+      cover: {
+        versionId: "0fa91ce3e96a4bc2be4bd9ce752c3425",
+        translated: [],
+        createdAt: "2020-08-06T06:26:45.420+00:00",
+        updatedAt: "2023-06-26T14:29:26.705+00:00",
+        productId: "65666d2629744f65b981cc6263d3ef0a",
+        mediaId: "0c25b06daa244618b342284498dc35ea",
+        position: 0,
+        media: {
+          translated: {
+            alt: null,
+            title: null,
+            customFields: {},
+          },
+          createdAt: "2020-08-06T06:25:50.000+00:00",
+          updatedAt: "2020-08-06T06:26:45.419+00:00",
+          mimeType: "image/jpeg",
+          fileExtension: "jpg",
+          fileSize: 369797,
+          title: null,
+          metaData: {
+            type: 2,
+            width: 1248,
+            height: 848,
+          },
+          uploadedAt: null,
+          alt: null,
+          url: "https://cdn.shopware.store/a/B/m/pPkDE/media/7e/8c/b2/PT_Ra-ucherbretter_Stein.jpg?1596695205",
+          fileName: "PT_Ra-ucherbretter_Stein",
+          translations: null,
+          thumbnails: [
+            {
+              translated: [],
+              createdAt: "2020-08-06T06:25:49.998+00:00",
+              updatedAt: "2020-08-06T06:26:45.417+00:00",
+              width: 400,
+              path: "thumbnail/7e/8c/b2/PT_Ra-ucherbretter_Stein_400x400.jpg",
+              height: 400,
+              url: "https://cdn.shopware.store/a/B/m/pPkDE/thumbnail/7e/8c/b2/PT_Ra-ucherbretter_Stein_400x400.jpg?1596695205",
+              mediaId: "0c25b06daa244618b342284498dc35ea",
+              customFields: null,
+              id: "6385b30ea2df41359c43393cbd1c4e7a",
+              apiAlias: "media_thumbnail",
+            },
+          ],
+          hasFile: true,
+          private: false,
+          path: "media/7e/8c/b2/PT_Ra-ucherbretter_Stein.jpg",
+          config: null,
+          customFields: null,
+          id: "0c25b06daa244618b342284498dc35ea",
+          apiAlias: "media",
+        },
+        customFields: null,
+        id: "0c25b06daa244618b342284498dc35ea",
+        apiAlias: "product_media",
+      },
+      parent: null,
+      children: null,
+      media: null,
+      cmsPageId: "7a6d253a67204037966f42b0119704d5",
+      cmsPage: null,
+      translations: null,
+      categories: null,
+      tags: null,
+      properties: null,
+      options: null,
+      configuratorSettings: null,
+      categoriesRo: null,
+      coverId: "0c25b06daa244618b342284498dc35ea",
+      tagIds: null,
+      categoryIds: ["6bb2662482fe42fb90129f32cdd645bb"],
+      productReviews: null,
+      ratingAverage: null,
+      mainCategories: null,
+      seoUrls: [
+        {
+          translated: [],
+          createdAt: "2020-08-06T06:26:52.576+00:00",
+          updatedAt: "2022-08-03T08:07:04.512+00:00",
+          salesChannelId: "98432def39fc4624b33213a56b8c944d",
+          languageId: "2fbb5fe2e29a4d70aa5854ce7ce3e20b",
+          routeName: "frontend.detail.page",
+          foreignKey: "65666d2629744f65b981cc6263d3ef0a",
+          pathInfo: "/detail/65666d2629744f65b981cc6263d3ef0a",
+          seoPathInfo: "Smoking-Board-Cedar-Wood/943280",
+          isCanonical: true,
+          isModified: false,
+          isDeleted: false,
+          url: null,
+          error: null,
+          customFields: null,
+          id: "74ab6a35516a46c288c5dc1292d0749e",
+          apiAlias: "seo_url",
+        },
+      ],
+      crossSellings: null,
+      canonicalProductId: null,
+      canonicalProduct: null,
+      streams: null,
+      downloads: null,
+      states: ["is-physical"],
+      customFields: {},
+      id: "65666d2629744f65b981cc6263d3ef0a",
+      calculatedPrices: [],
+      calculatedPrice: {
+        unitPrice: 17.9,
+        quantity: 1,
+        totalPrice: 17.9,
+        calculatedTaxes: [
+          {
+            tax: 1.17,
+            taxRate: 7,
+            price: 17.9,
+            apiAlias: "cart_tax_calculated",
+          },
+        ],
+        taxRules: [
+          {
+            taxRate: 7,
+            percentage: 100,
+            apiAlias: "cart_tax_rule",
+          },
+        ],
+        referencePrice: null,
+        listPrice: null,
+        regulationPrice: null,
+        apiAlias: "calculated_price",
+      },
+      sortedProperties: null,
+      calculatedCheapestPrice: {
+        unitPrice: 17.9,
+        quantity: 1,
+        totalPrice: 17.9,
+        calculatedTaxes: [
+          {
+            tax: 1.17,
+            taxRate: 7,
+            price: 17.9,
+            apiAlias: "cart_tax_calculated",
+          },
+        ],
+        taxRules: [
+          {
+            taxRate: 7,
+            percentage: 100,
+            apiAlias: "cart_tax_rule",
+          },
+        ],
+        referencePrice: null,
+        listPrice: null,
+        regulationPrice: null,
+        hasRange: false,
+        variantId: "65666d2629744f65b981cc6263d3ef0a",
+        apiAlias: "calculated_cheapest_price",
+      },
+      isNew: false,
+      calculatedMaxPurchase: 5,
+      seoCategory: null,
+      apiAlias: "product",
+    },
+    apiAlias: "cms_product_box",
+  },
+  locked: false,
+  cmsBlockVersionId: "0fa91ce3e96a4bc2be4bd9ce752c3425",
+  customFields: null,
+  apiAlias: "cms_slot",
+};
+
+export default CmsProductBox;


Test patch:
diff --git a/packages/composables/src/cms/useCmsElementProductBox.test.ts b/packages/composables/src/cms/useCmsElementProductBox.test.ts
new file mode 100644
index 00000000..b5292725
--- /dev/null
+++ b/packages/composables/src/cms/useCmsElementProductBox.test.ts
@@ -0,0 +1,15 @@
+import { describe, expect, it } from "vitest";
+import { useCmsElementProductBox } from "./useCmsElementProductBox";
+import { useSetup } from "../_test";
+import CmsProductBox from "../mocks/CmsProductBox";
+import type { CmsElementProductBox } from "../types/cmsElementTypes";
+
+describe("useCmsElementProductBox", () => {
+  it("should init product box", () => {
+    const { vm } = useSetup(() =>
+      useCmsElementProductBox(CmsProductBox as unknown as CmsElementProductBox),
+    );
+
+    expect(vm.product).toEqual(CmsProductBox.data.product);
+  });
+});
diff --git a/packages/composables/src/useCategorySearch.test.ts b/packages/composables/src/useCategorySearch.test.ts
new file mode 100644
index 00000000..f798304c
--- /dev/null
+++ b/packages/composables/src/useCategorySearch.test.ts
@@ -0,0 +1,48 @@
+import { describe, expect, it } from "vitest";
+import { useSetup } from "./_test";
+import { useCategorySearch } from "./useCategorySearch";
+
+describe("useCategorySearch", () => {
+  it("search method", () => {
+    const { vm, injections } = useSetup(useCategorySearch);
+    injections.apiClient.invoke.mockResolvedValue({
+      data: {},
+    });
+    vm.search("categoryId");
+
+    expect(injections.apiClient.invoke).toHaveBeenCalledWith(
+      expect.stringContaining("readCategory"),
+      expect.objectContaining({
+        pathParams: {
+          navigationId: "categoryId",
+        },
+        headers: {
+          "sw-include-seo-urls": true,
+        },
+      }),
+    );
+  });
+
+  it("advanced search method", () => {
+    const { vm, injections } = useSetup(useCategorySearch);
+    injections.apiClient.invoke.mockResolvedValue({
+      data: {},
+    });
+
+    vm.advancedSearch({
+      query: {
+        limit: 10,
+      },
+    });
+
+    expect(injections.apiClient.invoke).toHaveBeenCalledWith(
+      expect.stringContaining("readCategoryList"),
+      expect.objectContaining({
+        body: {
+          associations: {},
+          limit: 10,
+        },
+      }),
+    );
+  });
+});
diff --git a/packages/composables/vitest.config.ts b/packages/composables/vitest.config.ts
index 510a7f3b..539a1d5b 100644
--- a/packages/composables/vitest.config.ts
+++ b/packages/composables/vitest.config.ts
@@ -8,11 +8,17 @@ export default defineConfig({
       enabled: true,
       // "100": true, // TODO: our goal ;)
       thresholds: {
-        statements: 92,
+        statements: 94,
         branches: 80,
-        functions: 80,
+        functions: 82,
         lines: 92,
       },
+      exclude: [
+        "**/temp/**",
+        "**/devtools/**",
+        "**/.eslintrc.cjs",
+        "**/nuxt.config.ts",
+      ],
     },
     alias: {
       "#imports": resolve(__dirname, "./src/index.ts"),