These are chat archives for mojotech/pioneer

16th
Apr 2015
Dominik Guzei
@DominikGuzei
Apr 16 2015 10:33

Hey there, I can't get this to work:

@Then /^there should be no "([^"]*)" form field$/, (fieldClass) ->
  @currentForm.find(".#{fieldClass}").should.eventually.be.rejected

How can I check that a DOM element is not present? The code above hangs forever and never finishes.
But it correctly throws an error if the element does exist (which is equally important)

Dominik Guzei
@DominikGuzei
Apr 16 2015 10:50

Ok found a solution in the pioneer widget tests:

@Then /^there should be no "([^"]*)" form field$/, (fieldClass) ->
  @currentForm.isPresent(".#{fieldClass}")
  .then((isPresent) -> isPresent.should.be.false)

This works as expected although I think it is quite verbose for such a basic check