
* reference type cypress working * refactor * remove screenshots * add reference * add slash marker * run tests based on shop version * fix run tests based on shop version * fix run tests based on shop version * change base url to localhost * fix plugins * fix plugins * fix plugins * fix plugins * fix plugins * fix plugins * fix yml * fix yml * chage file names * fix files names * fix broken imports add checking for errors in grpah responses * fix broken imports add checking for errors in grpah responses * update jest * fix snapshot
31 lines
621 B
JavaScript
31 lines
621 B
JavaScript
export function getGiftCardWithTag(tag) {
|
|
return getGiftCardsWithTag(1, tag)
|
|
.its("body.data.giftCards.edges")
|
|
.its(0)
|
|
.its("node");
|
|
}
|
|
|
|
export function getGiftCardsWithTag(first, tag) {
|
|
const query = `query{
|
|
giftCards(first: ${first}, filter: { tag: "${tag}"}){
|
|
edges{
|
|
node{
|
|
id
|
|
code
|
|
isActive
|
|
expiryType
|
|
expiryDate
|
|
expiryPeriod{
|
|
amount
|
|
type
|
|
}
|
|
initialBalance{
|
|
currency
|
|
amount
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}`;
|
|
return cy.sendRequestWithQuery(query);
|
|
}
|