Fix for cleaning customers function in e2e (#2952)

This commit is contained in:
Anna Szczęch 2023-01-09 12:28:12 +01:00 committed by GitHub
parent d695bb9aa6
commit 2b4a819fae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,11 +33,13 @@ export function createCustomer(email, customerName, address, isActive = false) {
}
export function deleteCustomersStartsWith(startsWith) {
getCustomers(startsWith).then(resp => {
const serverStoredEmail = startsWith.toLowerCase();
getCustomers(serverStoredEmail).then(resp => {
if (resp.body.data.customers) {
const customers = resp.body.data.customers.edges;
customers.forEach(element => {
if (element.node.email.includes(startsWith)) {
if (element.node.email.includes(serverStoredEmail)) {
deleteCustomer(element.node.id);
}
});