diff options
author | winniehell <git@winniehell.de> | 2017-02-10 02:12:51 +0300 |
---|---|---|
committer | winniehell <git@winniehell.de> | 2017-02-14 20:20:58 +0300 |
commit | 409a3250438981331a6f97422d53bc1095ff13d4 (patch) | |
tree | c94c327406767d731bcff082124f45332d2cf586 /spec/javascripts/behaviors/requires_input_spec.js | |
parent | 640e977d4d5b6ab8f0c48f3b58a14ed2301d8257 (diff) |
Replace static fixture for behaviors/requires_input_spec.js (!9162)
Diffstat (limited to 'spec/javascripts/behaviors/requires_input_spec.js')
-rw-r--r-- | spec/javascripts/behaviors/requires_input_spec.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/spec/javascripts/behaviors/requires_input_spec.js b/spec/javascripts/behaviors/requires_input_spec.js index a958ac76e66..631fca06514 100644 --- a/spec/javascripts/behaviors/requires_input_spec.js +++ b/spec/javascripts/behaviors/requires_input_spec.js @@ -4,18 +4,19 @@ require('~/behaviors/requires_input'); (function() { describe('requiresInput', function() { - preloadFixtures('static/behaviors/requires_input.html.raw'); + preloadFixtures('branches/new_branch.html.raw'); beforeEach(function() { - return loadFixtures('static/behaviors/requires_input.html.raw'); + loadFixtures('branches/new_branch.html.raw'); + this.submitButton = $('button[type="submit"]'); }); it('disables submit when any field is required', function() { $('.js-requires-input').requiresInput(); - return expect($('.submit')).toBeDisabled(); + return expect(this.submitButton).toBeDisabled(); }); it('enables submit when no field is required', function() { $('*[required=required]').removeAttr('required'); $('.js-requires-input').requiresInput(); - return expect($('.submit')).not.toBeDisabled(); + return expect(this.submitButton).not.toBeDisabled(); }); it('enables submit when all required fields are pre-filled', function() { $('*[required=required]').remove(); @@ -25,9 +26,9 @@ require('~/behaviors/requires_input'); it('enables submit when all required fields receive input', function() { $('.js-requires-input').requiresInput(); $('#required1').val('input1').change(); - expect($('.submit')).toBeDisabled(); + expect(this.submitButton).toBeDisabled(); $('#optional1').val('input1').change(); - expect($('.submit')).toBeDisabled(); + expect(this.submitButton).toBeDisabled(); $('#required2').val('input2').change(); $('#required3').val('input3').change(); $('#required4').val('input4').change(); |