Browse Source

Remove flaky test mitigations that didn't work

pull/109/head
baarkerlounger 4 years ago
parent
commit
32c8bc8ef3
  1. 14
      app/javascript/controllers/soft_validations_controller.js
  2. 1
      spec/features/form/validations_spec.rb

14
app/javascript/controllers/soft_validations_controller.js

@ -5,13 +5,8 @@ export default class extends Controller {
initialize() {
let url = window.location.href + "/soft_validations"
this.fetch_retry(url, { headers: { accept: "application/json" } }, 5)
}
fetch_retry(url, options, n) {
let self = this
let div = this.overrideTarget
fetch(url, options)
fetch(url, { headers: { accept: "application/json" } })
.then(response => response.json())
.then((response) => {
if(response["show"]){
@ -27,10 +22,7 @@ export default class extends Controller {
button.checked = false
})
}
})
.catch(function(error) {
if (n === 1) throw error
return self.fetch_retry(url, options, n - 1)
})
}
)
}
}

1
spec/features/form/validations_spec.rb

@ -38,6 +38,7 @@ RSpec.describe "validations" do
fill_in("#{question}_2i", with: month)
fill_in("#{question}_3i", with: day)
end
it "does not allow out of range dates to be submitted" do
fill_in_date(id, "case_log_mrcdate", 3100, 12, 2000, "property_major_repairs")
click_button("Save and continue")

Loading…
Cancel
Save