Skip to content

Commit

Permalink
Added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiago Porto committed Feb 18, 2016
1 parent 168df1f commit 3ce603b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ describe("Functions events", function () {

body = $('body');

$_fontButton = $('#accessibility-font');

$_contrastButton = $('#accessibility-contrast');

accessibilityButtons();
});

Expand All @@ -22,6 +26,8 @@ describe("Functions events", function () {
expect($('#accessibility-font')).toHaveText('-A');

expect(body).toHaveClass('accessibility-font');
expect($_fontButton).toHaveText('-A');
expect($_fontButton).toHaveAttr('aria-label', 'Decrease Font');
})

it("Clicked font button twice", function () {
Expand All @@ -30,6 +36,8 @@ describe("Functions events", function () {
$('#accessibility-font').click().click();

expect(body).not.toHaveClass('accessibility-font');
expect($_fontButton).toHaveText('+A');
expect($_fontButton).toHaveAttr('aria-label', 'Increase Font');
})

it("Clicked font contrast", function () {
Expand All @@ -38,6 +46,8 @@ describe("Functions events", function () {
$('#accessibility-contrast').click();

expect(body).toHaveClass('accessibility-contrast');
expect($_contrastButton).toHaveText('Remove Contrast');
expect($_contrastButton).toHaveAttr('aria-label', 'Remove Contrast');
})


Expand All @@ -47,6 +57,8 @@ describe("Functions events", function () {
$('#accessibility-contrast').click().click();

expect(body).not.toHaveClass('accessibility-contrast');
expect($_contrastButton).toHaveText('Add Contrast');
expect($_contrastButton).toHaveAttr('aria-label', 'Add Contrast');
})

});

0 comments on commit 3ce603b

Please sign in to comment.