bitovi$ npm test
> i2web@1.16.0 test /Users/Bitovi/Clients/Lowes/i2web2
> npm-run-all lint test:unit
> i2web@1.16.0 lint /Users/Bitovi/Clients/Lowes/i2web2
> eslint src test --ext .js --ext .component
> i2web@1.16.0 test:unit /Users/Bitovi/Clients/Lowes/i2web2
> testee src/test.html --reporter Spec
Mocha "src/test.html" on PhantomJS 2.1.1 / Mac OS X 0.0.0:
i2web/components/accordion
– needs tests
i2web/components/accordion/panel
– needs tests
i2web/components/add-panel
rendering
✓ shall be rendered on the page
i2web/components/carousel
rendering
✓ shall be rendered on the page
i2web/components/iris-control-switch
instantiation
– without values
rendering
✓ displays the default value of the state of the device
✓ updates checked when device state is updated
interaction
✓ updates device state when clicked (120ms)
i2web/components/device
– needs tests
i2web/components/device/iris-device-configuration-panel
✓ shall render on the page
i2web/components/device/configurators/wifiScan
rendering
✓ shall be rendered on the page
i2web/components/device/detail-panel
✓ shall render on the page
✓ shall display correct device information
✓ shall display correct product information
i2web/components/event-list
rendering
✓ shall be rendered to the page with events
✓ shall render a heading of "Today" if the latest event occurred today
✓ shall render a heading of "Yesterday" if the latest event occured yesterday
✓ shall render a heading with the date of the latest event if the latest event occured more than a day ago
interactions
✓ shall route to the history page when the "More" button is clicked (93ms)
i2web/components/favorite
rendering
✓ shall be rendered on the page
✓ shall have the default color
✓ shall have the default icon
interactions
✓ shall, when clicked, change from default to active color (45ms)
✓ shall, when clicked, change from default to active icons (43ms)
✓ shall, when active and clicked again, change from active to default color (71ms)
✓ shall, when active and clicked again, change from active to default icon (70ms)
i2web/components/footer
rendering
✓ shall be rendered on the page
✓ renders with the current year in the footer
i2web/components/form
initialization
✓ shall mark required fields as not visited
✓ shall not have any form errors
rendering
✓ shall be rendered on the page
✓ shall render three text inputs
✓ shall have no errors by default
interactions
✓ shall mark a required field "visited" on blur (109ms)
✓ shall shall display an error if validation fails (101ms)
validation rules
✓ validates presence
✓ validates length
✓ validates oneLetterOneNumber
✓ validates noSpaces
✓ validates exclusion
✓ validates equality
✓ aren applied to non-required fields
– validates select fields
i2web/components/form/delete-account
rendering
✓ shall be rendered on the page
interaction
✓ shall, when something other than "DELETE" is entered into the input field, show not show next confirmation field (72ms)
✓ shall, when "delete" is entered into the input field, show the next confirmation field (73ms)
✓ shall, when "DELETE" is entered into the input field, show the next confirmation field (76ms)
✓ shall, when "Yes" is entered into the input field, account is deleted (74ms)
i2web/components/header
– needs tests
i2web/components/hub/detail-panel
✓ shall render on the page
✓ shall display correct hub information
i2web/components/hub/panel
✓ shall render on the page
i2web/components/icon-grid
rendering
✓ shall be rendered on the page
i2web/components/infinite-scroll
Source
✓ utilizes the regular template if no tombstone template was provided
✓ creates a tombstone with the tombstone class
✓ returns the same element when rendering when provided one
✓ returns the number of items you request when you fetch by default
i2web/components/notifications
✓ Inits with events
✓ Inits without events, then events are added later
✓ Inits without events, then events are added later not all at the same time
✓ Renders messages with HTML
✓ Renders messages with no HTML
i2web/components/pin-code
rendering
✓ shall be rendered on the page
✓ renders each element with the correct digit
i2web/components/rules/category-list
rendering
✓ shall be rendered on the page
i2web/components/rules/my-list
rendering
✓ shall be rendered on the page
functional
desc-parser
renderItem
– resolved
– unresolved
resolveDevice
– resolved
– unresolved
i2web/components/rules/edit-panel
rendering
✓ shall be rendered on the page
i2web/components/scene
– iris-scenes-card needs tests
– iris-scenes-icon needs tests
– iris-scenes-list-panel needs tests
i2web/components/scenes/action-device-selector
rendering
✓ shall be rendered on the page
– renders with no sceneDevices
– renders with 1 sceneDevice
– renders multiple sceneDevices
i2web/components/scenes/device-configurator
rendering
✓ shall be rendered on the page
– renders a group
– renders a list
– renders a boolean
– renders a range
– renders a duration
– renders a thermostat
i2web/components/scenes/edit-panel
rendering
✓ shall be rendered on the page
i2web/components/schedule/calendar
rendering
✓ shall be rendered on the page
i2web/components/schedule/calendar/day
rendering
✓ shall be rendered on the page
i2web/components/schedule/calendar/time-scale
rendering
✓ shall be rendered on the page
i2web/components/side-panel
rendering
✓ shall be rendered on the page with no content
✓ shall hide the panel container when there is no content
✓ shall hide the panel-backdrop when there is no content
rendering a template argument
✓ shall accept a template as a content.template property value
✓ shall NOT hide the panel container when there IS content
✓ shall NOT hide the panel-backdrop when there IS content
interactions
– shall hide the side-panel when "" is inserted and clicked
i2web/components/spinner
rendering
✓ shall be rendered on the page
i2web/components/subsystem/card
– needs tests
i2web/components/subsystem/favorites
rendering
✓ shall be rendered on the page
rendering all favorite devices
✓ shall render an iris-device-card for each favorite device on the place
✓ shall render a heading with total favorites count
i2web/components/subsystem/status/lights-switches
rendering
✓ shall render the number of "on" devices
✓ shall render the total number of devices
updates
✓ it shall update the on devices when the subsystem changes
✓ it shall update the total devices when the subsystem changes
i2web/components/thermostat
rendering
✓ shall be rendered on the page
interaction
– shows five checkboxes
– has the correct initial value checked
– sets scheduleEnabled to true when you click "Use Schedule"
– shows nothing when you click "OFF"
– sets mode to AUTO and shows 2 spinners when you click "Auto"
– sets mode to COOL and shows 1 spinner when you click "Cool"
– sets mode to HEAT and shows 1 spinner when you click "Heat"
i2web/components/wizard/iris-wizard
rendering
✓ shall render 1 wizard on the page
✓ shall render 3 steps on the page
interactions
✓ has one visible step and two hidden steps
✓ starts with one button that says "Begin"
✓ clicking the next button advances to step 2 (51ms)
✓ step 2 has a back button labeled "Prev" and a disabled next button labeled "Next"
✓ clicking the previous button goes back to step 1 (77ms)
✓ clicking "Next" while it's disabled does not go to step 3 (45ms)
✓ checking the box enables the next button (42ms)
✓ clicking the next button advances to step 3 (44ms)
✓ step 3 has no nav buttons
i2web/connections/helpers/changeStore
add
✓ keeps entries list unique
when writeableAttributes is undefined
✓ adds any property
when serialize is defined
✓ adds a serialized property
✓ does not add an unserialized property
when writeableAttributes is defined
✓ adds a writeable property
✓ does not add a non-writeable property
get
when an instance has entries
✓ returns array of entries
when an instance has no entries
✓ returns blank array
clear
✓ clears all entries for an instance
✓ leaves other instance entries
i2web/connections/helpers/overwrite
when overwriting a prototype function
✓ overwrite function is called once
the overwritten function
✓ can invoke base function
✓ can invoke a connection function
when overwriting a static function
✓ overwrite function is called once
the overwritten function
✓ can invoke base function
✓ can invoke a connection function
i2web/connections/can-map-diff
tracking changes
✓ changes to writeable attributes are tracked
✓ changes to non-writeable attributes are not tracked
✓ changes to top-level attributes are tracked
saving
after a successful save
✓ tracked changes are removed
after an unsuccessful save
✓ tracked changes are not removed
i2web/connections/can-map-address
Making a `get` request with a base:id
✓ Adds a base:address property
i2web/connections/merge-data
✓ patch update does not remove missing properties
when removeAttr is true
retrieving an instance
✓ does not remove missing properties
updating an instance
✓ merges arrays
✓ replaces populated arrays with empty ones
i2web/connections/data-cornea
get
Using the base:address
✓ Calls bridge base:GetAttributes with proper destination
Using the base:id
✓ Calls bridge base:GetAttributes with proper destination
save
✓ Calls bridge base:SetAttributes with proper destination
✓ Calls bridge base:SetAttributes with only changed (writeable) attributes
✓ Does not calls bridge base:SetAttributes if nothing has changed
i2web/cornea/library
initialise
✓ throws an error if no url is provided
✓ throws an error if WebSockets are not supported
✓ returns a Promise
✓ Returns existing Promise if called multiple times
connecting
✓ creates a WebSocket connection
connection deferred
✓ is resolved when connection is successful (59ms)
✓ is rejected when connection is unsuccessful
binds to WebSocket events
✓ onopen
✓ onclose
✓ onmessage
✓ onerror
send
✓ returns a Promise
✓ rejects promise if socket is not open
after being connected
✓ rejects promise if socket is closed
A request
✓ resolves promise when response is received
✓ rejects promise when response is an error
✓ rejects promise if response times out (201ms)
receiving
events with a subject
✓ emits a subject event
events without a subject
✓ emits an eventType event
closing
manually
✓ closes the WebSocket
✓ cleans up the WebSocket
✓ emits a WebSocketClosed event
from the server cleanly
✓ closes the WebSocket
✓ cleans up the WebSocket
✓ emits a WebSocketClosed event
from the server
✓ closes the WebSocket
reconnecting
when server disconnects cleanly
✓ cleans up Cornea instance
i2web/cornea/bridge
message formatting
✓ adds type
headers
✓ sets isRequest to `true`
✓ adds destination
payload
✓ adds messageType
✓ sets attributes to empty Object of none are provided
✓ adds attributes if defined
request
✓ calls Cornea.send
✓ returns Promise
✓ resolves Promise if request succeeds
✓ rejects Promise if request fails
restfulRequest
✓ returns Promise
✓ resolves Promise if request succeeds
✓ rejects Promise if request fails
✓ sends stringified attributes to URL
i2web/cornea/backoff
start
✓ invokes callback after initial delay
continue
✓ invokes callback after doubled delay
✓ delay doubles each time
✓ delay never exceed max
reset
✓ stops current iteration
cancel
✓ stops current iteration
✓ prevents continue from workin
i2web/pages/devices
initial render
✓ shall be rendered on the page
rendering hub
✓ shall render an iris-hub-panel for the hub
rendering all devices
✓ shall render an iris-device-panel for each device on the place
rendering a single device
– shall render 1 device when deviceId is the device id
i2web/pages/history
– needs tests
i2web/pages/home
– needs tests
i2web/pages/login
– needs tests
i2web/pages/rules
rendering
✓ shall be rendered on the page
✓ shall render MY RULES as the default content
✓ shall display information text below button in MY RULES
interaction
✓ shall display text following the buttons when "ADD A RULE" is selected (98ms)
i2web/pages/scenes
rendering
✓ shall be rendered on the page
i2web/pages/services
– needs tests
i2web/pages/settings
rendering
✓ shall be rendered on the page
– renders more panels for account owners than non-owners
interactions
– shall opt a user into marketing material when checked and opt out when unchecked
i2web functional smoke test
rendering
✓ shall be render the login component on the page (7750ms)
443 passing (32s)
38 pending