         expect(symbolsView.loading).toHaveText 'Generating symbols...'
 
       waitsFor ->
-        setItemsSpy.callCount > 0
+        symbolsView.list.children('li').length > 0
 
       runs ->
         expect(symbolsView.loading).toBeEmpty()

TagGenerator = require '../lib/tag-generator'

describe "SymbolsView", ->
  [symbolsView, setItemsSpy, setErrorSpy, activationPromise] = []

  beforeEach ->
    atom.workspaceView = new WorkspaceView
    atom.project.setPath(temp.mkdirSync('atom-symbols-view-'))
    fs.copySync(path.join(__dirname, 'fixtures'), atom.project.getPath())

    activationPromise = atom.packages.activatePackage("symbols-view")

    atom.workspaceView.attachToDom()
    setItemsSpy = spyOn(SymbolsView.prototype, 'setItems').andCallThrough()

  describe "when tags can be generated for a file", ->
    it "initially displays all JavaScript functions with line numbers", ->

        expect(symbolsView.loading).toHaveText 'Loading symbols...'

      waitsFor ->
        symbolsView.list.children('li').length > 0

      runs ->
        expect(symbolsView.loading).toBeEmpty()
