← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1493354] Re: Some angular unit tests use a wrong way of checking if an element exists

 

** Changed in: horizon
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1493354

Title:
  Some angular unit tests use a wrong way of checking if an element
  exists

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  I've noticed a few occurrences of the following pattern in the Horizon
  unit tests for Angular directives:
  `expect(element.find(someSelector)).toBeDefined()`. That is going to
  always true, since element.find(someSelector) returns an Array-like
  object which _is_ defined. The correct pattern to use with such
  selectors is `expect(element.find(someSelector).length).toBe(1)`.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1493354/+subscriptions


References