@instructure/quiz-interactions
Version:
A React UI component Library for quiz interaction types.
32 lines (28 loc) • 699 B
JavaScript
import interactionPoints from '../interactionPoints'
describe('interactionPoints', () => {
it('should return undefined when item does not define its own points', () => {
expect(interactionPoints({})).toBeUndefined()
})
describe('vary points by answer', () => {
const varyProps = {
properties: {
varyPointsByAnswer: true,
},
scoringData: {
values: [
{
value: 'someId',
points: 3,
},
{
value: 'otherId',
points: 5.5,
},
],
},
}
it('returns max points of choices', () => {
expect(interactionPoints(varyProps)).toBe(5.5)
})
})
})