From 528987342add692630bc303a5696ef1364b1e6f3 Mon Sep 17 00:00:00 2001 From: David Baumgold Date: Tue, 14 May 2013 14:56:27 -0400 Subject: [PATCH] Add tests for primary and secondary CSS classes --- cms/static/coffee/spec/views/feedback_spec.coffee | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cms/static/coffee/spec/views/feedback_spec.coffee b/cms/static/coffee/spec/views/feedback_spec.coffee index 428e4c3f30..b8d0d269da 100644 --- a/cms/static/coffee/spec/views/feedback_spec.coffee +++ b/cms/static/coffee/spec/views/feedback_spec.coffee @@ -58,14 +58,17 @@ describe "SystemFeedback click events", -> actions: primary: text: "Save", + class: "save-button", click: jasmine.createSpy('primaryClick') secondary: [{ text: "Revert", + class: "cancel-button", click: jasmine.createSpy('secondaryClick') }] ) + setFixtures(sandbox({id: "page-alert"})) @view = new CMS.Views.Alert({model: @model}) it "should trigger the primary event on a primary click", -> @@ -75,3 +78,10 @@ describe "SystemFeedback click events", -> it "should trigger the secondary event on a secondary click", -> @view.secondaryClick() expect(@model.get('actions').secondary[0].click).toHaveBeenCalled() + + it "should apply class to primary action", -> + expect(@view.$(".action-primary")).toHaveClass("save-button") + + it "should apply class to secondary action", -> + expect(@view.$(".action-secondary")).toHaveClass("cancel-button") +