
* test plan for sales - discounts * create sale * passing tests for sales * tests for collections * remove eslint diable in sales tests * remove eslint-disable * move shared selectors * move shared selectors * fix indentation in requests * add formatDate function * remove moment * remove moment
49 lines
1,017 B
JavaScript
49 lines
1,017 B
JavaScript
export function createChannel(isActive, name, slug, currencyCode) {
|
|
const createChannelMutation = `mutation{
|
|
channelCreate(input: {
|
|
isActive: ${isActive}
|
|
name: "${name}"
|
|
slug: "${slug}"
|
|
currencyCode: "${currencyCode}"
|
|
}){
|
|
channel{
|
|
id
|
|
name
|
|
slug
|
|
}
|
|
channelErrors{
|
|
code
|
|
message
|
|
}
|
|
}
|
|
}`;
|
|
return cy.sendRequestWithQuery(createChannelMutation);
|
|
}
|
|
export function getChannels() {
|
|
const getChannelsInfoQuery = `query{
|
|
channels{
|
|
name
|
|
id
|
|
isActive
|
|
slug
|
|
currencyCode
|
|
}
|
|
}`;
|
|
return cy.sendRequestWithQuery(getChannelsInfoQuery);
|
|
}
|
|
|
|
export function deleteChannel(channelId, targetChannelId) {
|
|
const deleteChannelMutation = `mutation{
|
|
channelDelete(id: "${channelId}", input:{
|
|
targetChannel: "${targetChannelId}"
|
|
}){
|
|
channel{
|
|
name
|
|
}
|
|
channelErrors{
|
|
message
|
|
}
|
|
}
|
|
}`;
|
|
return cy.sendRequestWithQuery(deleteChannelMutation);
|
|
}
|