-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test cases all shopping api's (#85)
* v2.7.7 * added test for shopping api
- Loading branch information
Showing
8 changed files
with
171 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,54 @@ | ||
let expect = require('chai').expect; | ||
let should = require('chai').should(); | ||
let eBay = require('../src/index'); | ||
let Ebay = require('../src/index'); | ||
|
||
describe('check all the options provided is valid or not - Ebay Constructor ', () => { | ||
it('check input is provided or not', () => { | ||
expect(() => { | ||
new eBay(); | ||
new Ebay(); | ||
}).to.throw('Options is missing, please provide the input'); | ||
}); | ||
|
||
it('should have client ID', () => { | ||
let ebayApi = new eBay({ clientID: '12345' }); | ||
let ebayApi = new Ebay({ clientID: '12345' }); | ||
ebayApi.options.should.have.property('clientID'); | ||
}); | ||
|
||
it('should not have client ID', () => { | ||
expect(() => { | ||
new eBay({}); | ||
new Ebay({}); | ||
}).to.throw('Client ID is Missing\ncheck documentation to get Client ID http://developer.ebay.com/DevZone/account/'); | ||
}); | ||
|
||
it('check instance of Ebay', () => { | ||
let ebayApi = new eBay({ clientID: '12345' }); | ||
expect(ebayApi).to.be.a.instanceOf(eBay); | ||
let ebayApi = new Ebay({ clientID: '12345' }); | ||
expect(ebayApi).to.be.a.instanceOf(Ebay); | ||
}); | ||
|
||
}); | ||
|
||
|
||
it('test default params', () => { | ||
const ebay = new Ebay({ | ||
clientID: 'ClientId' | ||
}); | ||
const expected = { | ||
clientID: 'ClientId', | ||
env: 'PROD', | ||
baseUrl: 'api.ebay.com', | ||
baseSvcUrl: 'svcs.ebay.com', | ||
globalID: 'EBAY-US', | ||
siteId: '0' | ||
}; | ||
expect(ebay.options).to.deep.equal(expected); | ||
}); | ||
|
||
it('test site id, env and country code', () => { | ||
const ebay = new Ebay({ | ||
clientID: 'ClientId', | ||
siteId: 3, | ||
env: 'SANDBOX', | ||
countryCode: 'EBAY_UK' | ||
}); | ||
expect(ebay.options.siteId).to.equals(3); | ||
expect(ebay.options.env).to.equals('SANDBOX'); | ||
expect(ebay.options.globalID).to.equals('EBAY_UK'); | ||
}); | ||
}); |
Oops, something went wrong.