       generateFakeFetchResponses()
 
     it "adds an .notifications-log-item element to the container with a class corresponding to the type", ->
-      expect(notificationsLogContainer.childNodes.length).toBe 1
-
       atom.notifications.addSuccess('A message')
       notification = notificationsLogContainer.querySelector('.notifications-log-item.success')
-      expect(notificationsLogContainer.childNodes.length).toBe 2
+      expect(notificationsLogContainer.childNodes).toHaveLength 2
       expect(notification.querySelector('.message').textContent.trim()).toBe 'A message'
       expect(notification.querySelector('.btn-toolbar')).toBeEmpty()
 
       atom.notifications.addInfo('A message')
-      expect(notificationsLogContainer.childNodes.length).toBe 3
+      expect(notificationsLogContainer.childNodes).toHaveLength 3
       expect(notificationsLogContainer.querySelector('.notifications-log-item.info')).toBeDefined()
 
       atom.notifications.addWarning('A message')
-      expect(notificationsLogContainer.childNodes.length).toBe 4
+      expect(notificationsLogContainer.childNodes).toHaveLength 4
       expect(notificationsLogContainer.querySelector('.notifications-log-item.warning')).toBeDefined()
 
       atom.notifications.addError('A message')
-      expect(notificationsLogContainer.childNodes.length).toBe 5
+      expect(notificationsLogContainer.childNodes).toHaveLength 5
       expect(notificationsLogContainer.querySelector('.notifications-log-item.error')).toBeDefined()
 
       atom.notifications.addFatalError('A message')
       notification = notificationsLogContainer.querySelector('.notifications-log-item.fatal')
-      expect(notificationsLogContainer.childNodes.length).toBe 6
+      expect(notificationsLogContainer.childNodes).toHaveLength 6
       expect(notification).toBeDefined()
       expect(notification.querySelector('.btn-toolbar')).not.toBeEmpty()
 


  describe "when notifications are added to atom.notifications", ->
    notificationsLogContainer = null
    beforeEach ->
      enableInitNotification = atom.notifications.addSuccess('A message to trigger initialization', dismissable: true)
      enableInitNotification.dismiss()

{generateFakeFetchResponses, generateException} = require './helper'

describe "Notifications Log", ->
  workspaceElement = null

  beforeEach ->
    workspaceElement = atom.views.getView(atom.workspace)
    atom.notifications.clear()

    waitsForPromise ->
      atom.packages.activatePackage('notifications')

    waitsForPromise ->
      atom.workspace.open(NotificationsLog::getURI())
