-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(spell-import): Importing Spell List gives an error
Introduced version checking as well to prevent problems with mismatched character sheet versions. Partial fix for #12. closes #334
- Loading branch information
Showing
5 changed files
with
74 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* globals describe: false, it:false, beforeEach:false, before:false */ | ||
'use strict'; | ||
const Roll20 = require('roll20-wrapper'); | ||
const expect = require('chai').expect; | ||
const AbilityMaker = require('../lib/ability-maker'); | ||
const sinon = require('sinon'); | ||
const logger = require('./dummy-logger'); | ||
const Reporter = require('./dummy-reporter'); | ||
const cp = require('./dummy-command-parser'); | ||
const Roll20Object = require('./dummy-roll20-object'); | ||
|
||
describe('ability-maker', function () { | ||
let roll20; | ||
|
||
beforeEach(function () { | ||
roll20 = new Roll20(); | ||
}); | ||
|
||
|
||
describe('ability creation', function () { | ||
it('should create save ability', function () { | ||
sinon.stub(roll20); | ||
const characterStub = new Roll20Object('character'); | ||
characterStub.set('name', 'Bob'); | ||
const abilityStub = new Roll20Object('ability'); | ||
roll20.getOrCreateObj.withArgs('ability', { | ||
characterid: characterStub.id, | ||
name: 'Saves', | ||
}).returns(abilityStub); | ||
const abilityMaker = new AbilityMaker(); | ||
abilityMaker.configure(roll20, new Reporter(), logger, {}, cp); | ||
abilityMaker.addAbility({ | ||
selected: { character: [characterStub] }, | ||
abilities: [abilityMaker.staticAbilityOptions.saves], | ||
}); | ||
|
||
expect(roll20.getOrCreateObj.withArgs('ability', { | ||
characterid: characterStub.id, | ||
name: 'Saves', | ||
}).callCount).to.equal(1); | ||
}); | ||
}); | ||
}); |
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