mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Add spec for busting the cache on window focus
This commit is contained in:
@@ -228,3 +228,23 @@ describe 'FuzzyFinder', ->
|
||||
|
||||
runs ->
|
||||
expect(rootView.project.getFilePaths).toHaveBeenCalled()
|
||||
|
||||
it "busts the cache when the window gains focus", ->
|
||||
spyOn(rootView.project, "getFilePaths").andCallThrough()
|
||||
rootView.trigger 'fuzzy-finder:toggle-file-finder'
|
||||
|
||||
waitsFor ->
|
||||
finder.list.children('li').length > 0
|
||||
|
||||
runs ->
|
||||
expect(rootView.project.getFilePaths).toHaveBeenCalled()
|
||||
rootView.project.getFilePaths.reset()
|
||||
$(window).trigger 'focus'
|
||||
rootView.trigger 'fuzzy-finder:toggle-file-finder'
|
||||
rootView.trigger 'fuzzy-finder:toggle-file-finder'
|
||||
|
||||
waitsFor ->
|
||||
finder.list.children('li').length > 0
|
||||
|
||||
runs ->
|
||||
expect(rootView.project.getFilePaths).toHaveBeenCalled()
|
||||
|
||||
Reference in New Issue
Block a user