 
       expect(listView.getFilterKey()).toBe listView.defaultFilterKey
       expect(listView.getFilterQuery()).toBe '1'
-      expect(list.find('li').length).toBe 1+      expect(list.find('li').length).toBe 1
+
+  describe "It sorts the projects in correct order", ->
+    it "sorts after title", ->
+      atom.config.set('project-manager.sortBy', 'title')
+      listView.show(projects())
+      expect(list.find('li:eq(0)').data('projectTitle')).toBe "Test project 1"
+
+    it "sort after group", ->
+      atom.config.set('project-manager.sortBy', 'group')
+      listView.show(projects())
+      expect(list.find('li:eq(0)').data('projectTitle')).toBe "Test project 2"

  describe "When the text of the mini editor changes", ->
    beforeEach ->
      listView.isOnDom = -> true # Fix this somehow

    it "will only list projects with the correct title", ->

  data =
    testproject1:
      title: "Test project 1"
      paths: ["/Users/project-1"]
    testproject2:
      title: "Test project 2"
      paths: ["/Users/project-2"]
      template: "test-template"
      icon: "icon-bug"
      group: "Test"

  projects = ->
    array = []
