 
 PackageManager = require '../lib/package-manager'
 ThemesPanel = require '../lib/themes-panel'
+SettingsView = require '../lib/settings-view'
 
 describe "ThemesPanel", ->
   [panel, packageManager, reloadedHandler] = []
+  settingsView = null
 
   beforeEach ->
+    settingsView = new SettingsView
     atom.packages.loadPackage('atom-light-ui')
     atom.packages.loadPackage('atom-dark-ui')
     atom.packages.loadPackage('atom-light-syntax')

      runs ->
        expect(panel.uiMenu.val()).toBe 'atom-light-ui'
        expect(panel.syntaxMenu.val()).toBe 'atom-light-syntax'

      spyOn(packageManager, 'getFeatured').andCallFake (callback) ->
        Q([themeMetadata])
      panel = new ThemesPanel(packageManager)
      settingsView.addPanel('Themes', null, -> panel)

      # Make updates synchronous
      spyOn(panel, 'scheduleUpdateThemeConfig').andCallFake -> @updateThemeConfig()
