Repository: medusajs/medusa
File: integration-tests/http/__tests__/product-category/admin/product-category.spec.ts (TypeScript)

Code before:
        const response = await api.get(
          `/admin/product-categories?is_internal=true&limit=7`,
          adminHeaders
        )

        expect(response.status).toEqual(200)
        expect(response.data.count).toEqual(1)
        expect(response.data.product_categories[0].id).toEqual(
          productCategory.id
        )
      })

      it("filters based on handle attribute of the data model", async () => {
        const response = await api.get(
          `/admin/product-categories?handle=${productCategory.handle}&limit=2`,
          adminHeaders
        )

        expect(response.status).toEqual(200)
        expect(response.data.count).toEqual(1)
        expect(response.data.product_categories[0].id).toEqual(
          productCategory.id
        )
      })

      it("filters based on handle and retrieves descendants tree", async () => {
        const response = await api.get(
          `/admin/product-categories?handle=${productCategoryParent.handle}&include_descendants_tree=true`,
          adminHeaders
        )

        expect(response.status).toEqual(200)
        expect(response.data.product_categories).toEqual([
          expect.objectContaining({
            id: productCategoryParent.id,
            handle: productCategoryParent.handle,
            category_children: [
              expect.objectContaining({
                id: productCategory.id,
                handle: productCategory.handle,
                category_children: [
                  expect.objectContaining({
                    id: productCategoryChild.id,
                    handle: productCategoryChild.handle,
                  }),
                ],
              }),
            ],
          }),
        ])
      })

Review comment (suggestion):
nit: I prefer all test to start with `should` verb to create sentences (or mostly) when reading the test 😄 

Code after:
        const response = await api.get(
          `/admin/product-categories?is_internal=true&limit=7`,
          adminHeaders
        )

        expect(response.status).toEqual(200)
        expect(response.data.count).toEqual(1)
        expect(response.data.product_categories[0].id).toEqual(
          productCategory.id
        )
      })

      it("filters based on handle attribute of the data model", async () => {
        const response = await api.get(
          `/admin/product-categories?handle=${productCategory.handle}&limit=2`,
          adminHeaders
        )

        expect(response.status).toEqual(200)
        expect(response.data.count).toEqual(1)
        expect(response.data.product_categories[0].id).toEqual(
          productCategory.id
        )
      })

      it("should filter by handle and retrieve descendants tree", async () => {
        const response = await api.get(
          `/admin/product-categories?handle=${productCategoryParent.handle}&include_descendants_tree=true`,
          adminHeaders
        )

        expect(response.status).toEqual(200)
        expect(response.data.product_categories).toEqual([
          expect.objectContaining({
            id: productCategoryParent.id,
            handle: productCategoryParent.handle,
            category_children: [
              expect.objectContaining({
                id: productCategory.id,
                handle: productCategory.handle,
                category_children: [
                  expect.objectContaining({
                    id: productCategoryChild.id,
                    handle: productCategoryChild.handle,
                  }),
                ],
              }),
            ],
          }),
        ])
      })