@instructure/quiz-interactions
Version:
A React UI component Library for quiz interaction types.
30 lines (25 loc) • 676 B
JavaScript
import React from 'react'
import {numericTakeTests} from '../../../numeric/Take/__tests__/Take.test'
import FormulaTake from '../index'
import {render, screen} from '@testing-library/react'
describe('Formula Take', () => {
const props = {
itemBody: '`a` b',
interactionData: {
variables: [
{
name: 'a',
value: 123.45667,
},
],
},
userResponse: {
value: '18',
},
}
numericTakeTests(FormulaTake, props)
it('substitutes the variables', async () => {
render(<FormulaTake handleResponseUpdate={() => {}} {...props} />)
expect(screen.getAllByText(/123\.45667 b/)).toHaveLength(2)
})
})