* fix: multi lines and spaces issues * fix: eslint operator-linebreak issue * fix: eslint quotes issue * fix: remaining quotes issues * fix: eslint object curly newline issue * fix: eslint object curly spacing issue * fix: eslint brace-style issues * fix: react jsx indent and props issues * fix: eslint trailing spaces issues * fix: eslint linbreak style issue * fix: eslint space unary operator issue * fix: eslint line around directives issue * fix: void and typeof space unary ops issue
29 lines
908 B
JavaScript
29 lines
908 B
JavaScript
describe('JSInput', function() {
|
|
var $jsinputContainers;
|
|
var $inputFields;
|
|
|
|
beforeEach(function() {
|
|
loadFixtures('js/capa/fixtures/jsinput.html');
|
|
$jsinputContainers = $('.jsinput');
|
|
$inputFields = $('input[id^="input_"]');
|
|
JSInput.walkDOM();
|
|
});
|
|
|
|
it('sets all data-processed attributes to true on first load', function() {
|
|
$jsinputContainers.each(function(index, item) {
|
|
expect(item).toHaveData('processed', true);
|
|
});
|
|
});
|
|
|
|
it('sets the waitfor attribute to its update function', function() {
|
|
$inputFields.each(function(index, item) {
|
|
expect(item).toHaveAttr('waitfor');
|
|
});
|
|
});
|
|
|
|
it('tests the correct number of jsinput instances', function() {
|
|
expect($jsinputContainers.length).toEqual(2);
|
|
expect($jsinputContainers.length).toEqual($inputFields.length);
|
|
});
|
|
});
|