UNPKG

trailpack-proxy-cart

Version:

eCommerce - Trailpack for Proxy Engine

32 lines (27 loc) 955 B
'use strict' /* global describe, it */ const assert = require('assert') const supertest = require('supertest') const _ = require('lodash') describe('Admin User View Product with Collection Discount', () => { let adminUser, userID, customerID, cartID, shopID, shopProducts, orderID, transactionID before((done) => { shopID = global.app.shopID shopProducts = global.app.shopProducts adminUser = supertest.agent(global.app.packs.express.server) // Login as Admin adminUser .post('/auth/local') .set('Accept', 'application/json') //set header for this test .send({username: 'admin', password: 'admin1234'}) .expect(200) .end((err, res) => { assert.ok(res.body.user.id) assert.ok(res.body.user.current_customer_id) userID = res.body.user.id customerID = res.body.user.current_customer_id cartID = res.body.user.current_cart_id done(err) }) }) })