+beforeEach ->
+    @addMatchers
+        toBeShown: ->
+            @actual.hasClass("is-shown") and not @actual.hasClass("is-hiding")
+        toBeHiding: ->
+            @actual.hasClass("is-hiding") and not @actual.hasClass("is-shown")
+
 describe "CMS.Views.Alert as base class", ->
     tpl = readFixtures('alert.underscore')
 

    it "renders the template", ->
        view = new CMS.Views.Alert({model: @model})
        expect(view.$(".action-close")).toBeDefined()
        expect(view.$('.wrapper')).toHaveClass("is-shown")
        expect(view.$el).toContainText(@model.get("title"))
        expect(view.$el).toContainText(@model.get("message"))


        # can't hide early
        @clock.tick(50)
        view.hide()
        expect(view.$('.wrapper')).toBeShown()
        @clock.tick(1000)
        expect(view.$('.wrapper')).toBeHiding()

        # show it again, and let it hide automatically
        view.show()
        @clock.tick(1050)
        expect(view.$('.wrapper')).toBeShown()
        @clock.tick(1000)
        expect(view.$('.wrapper')).toBeHiding()
