saleor-dashboard/cypress/support/api/requests/storeFront/Collections.js
Karolina Rakoczy ef983cc347
Add tests for updating & deleting collections and categories (#1662) (#1693)
* tests for updating & deleting collections and categories

* add empty spaces

* fix create category
2021-12-22 12:27:28 +01:00

26 lines
587 B
JavaScript

import { getValueWithDefault } from "../utils/Utils";
export function getCollection({ collectionId, channelSlug, auth = "token" }) {
const channelLine = getValueWithDefault(
channelSlug,
`channel: "${channelSlug}"`
);
const query = `query Collection{
collection(id: "${collectionId}" ${channelLine}) {
id
slug
name
description
products(first:100){
totalCount
edges{
node{
id
name
}
}
}
}
}`;
return cy.sendRequestWithQuery(query, auth).its("body.data");
}