Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/js-evo-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"build": "rm -rf dist && tsc -p tsconfig.json && webpack --config webpack.config.cjs",
"lint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\"",
"test": "yarn run test:unit",
"test:unit": "mocha --import ts-node/esm --require tests/bootstrap.cjs tests/unit/**/*.spec.ts && karma start ./tests/karma/karma.conf.cjs --single-run"
"test:unit": "TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=tests/tsconfig.json TS_NODE_FILES=true mocha --node-option loader=ts-node/esm --require tests/bootstrap.cjs tests/unit/**/*.spec.ts && karma start ./tests/karma/karma.conf.cjs --single-run"
},
"devDependencies": {
"@types/chai": "^4.3.11",
Expand Down
22 changes: 18 additions & 4 deletions packages/js-evo-sdk/tests/unit/facades/tokens.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,26 @@ describe('TokensFacade', () => {
});

describe('setPrice()', () => {
it('should set direct purchase price for tokens', async () => {
it('should set a flat direct purchase price for tokens', async () => {
const options = {
tokenId,
price: {
type: 'fixed',
value: BigInt(1000000), // 1M credits per token
price: BigInt(1000000), // 1M credits per token
identityKey,
signer,
};

const result = await client.tokens.setPrice(options);

expect(tokenSetPriceStub).to.be.calledOnceWithExactly(options);
expect(result.tokenId).to.equal(tokenId);
});

it('should forward a tiered direct purchase price schedule unchanged', async () => {
const options = {
tokenId,
priceTiers: {
'100': BigInt(1000),
'1000': BigInt(900),
},
identityKey,
signer,
Expand Down
Loading
Loading