Skip to content

Instantly share code, notes, and snippets.

@bmfteixeira
Last active November 5, 2017 22:27
Show Gist options
  • Save bmfteixeira/e81e30536a3c84c303df298849564a01 to your computer and use it in GitHub Desktop.
Save bmfteixeira/e81e30536a3c84c303df298849564a01 to your computer and use it in GitHub Desktop.
// Working with the object here!
import Probability from '../probability.vue'
describe('Probability component', () => {
describe('Computed ', () => {
it('getClasses', done => {
const context = {
classModifiers: ['medium', 'blue-theme', 'rounded-corners']
}
expect(Probability.computed.getClasses.call(context))
.to.be.eql(['probability--medium', 'probability--blue-theme', 'probability--rounded-corners'])
done()
})
it('baseProbability - should return 0.8 when "large" is on the classModifiers list', done => {
const context = {
classModifiers: ['large', 'blue-theme', 'rounded-corners']
}
expect(Probability.computed.baseProbability.call(context)).to.be.eq(.8)
done()
})
it('baseProbability - should return 0.5 when "large" is not on the classModifiers list', done => {
const context = {
classModifiers: ['medium', 'blue-theme', 'rounded-corners']
}
expect(Probability.computed.baseProbability.call(context)).to.be.eq(.5)
done()
})
})
describe('Methods ', () => {
it('calcProbability', done => {
const context = {
baseProbability: .5
}
expect(Loading.methods.calcProbability.call(context, 100)).to.be.eq(50)
done()
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment