Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

FLUID-4862: Cleanup of tests

  • Loading branch information...
commit a04184cdfbada11c0a1f3ab953a5af33ac3a2972 1 parent 8030a66
@acheetham acheetham authored
View
12 html/videoPlayer_template.html
@@ -12,12 +12,10 @@
<div class="fl-videoPlayer-controller-buttons">
<div class="fl-videoPlayer-controller-buttons-main">
- <button type="button" class="flc-videoPlayer-play fl-videoPlayer-button">
- </button>
+ <button type="button" class="flc-videoPlayer-play fl-videoPlayer-button"></button>
<div class="flc-videoPlayer-volumeContainer fl-videoPlayer-volumeContainer">
- <button type="button" class="flc-videoPlayer-mute fl-videoPlayer-button">
- </button>
+ <button type="button" class="flc-videoPlayer-mute fl-videoPlayer-button"></button>
<div class="flc-videoPlayer-volumeControl"></div>
</div>
</div>
@@ -41,8 +39,7 @@
<div class="fl-videoPlayer-controller-buttons-secondary">
<div class="flc-videoPlayer-captionControls-container fl-videoPlayer-captions">
- <button class="flc-videoPlayer-captions-button fl-videoPlayer-button">
- </button>
+ <button class="flc-videoPlayer-captions-button fl-videoPlayer-button"></button>
<ul class="flc-videoPlayer-captions-languageMenu fl-videoPlayer-languageMenu">
<li class="flc-videoPlayer-language flc-videoPlayer-menuItem fl-videoPlayer-menuItem"></li>
<li class="flc-videoPlayer-languageNone flc-videoPlayer-menuItem fl-videoPlayer-menuItem"></li>
@@ -50,8 +47,7 @@
</div>
<div class="flc-videoPlayer-transcriptControls-container fl-videoPlayer-transcript">
- <button class="flc-videoPlayer-transcripts-button fl-videoPlayer-button">
- </button>
+ <button class="flc-videoPlayer-transcripts-button fl-videoPlayer-button"></button>
<ul class="flc-videoPlayer-transcripts-languageMenu fl-videoPlayer-languageMenu">
<li class="flc-videoPlayer-language flc-videoPlayer-menuItem fl-videoPlayer-menuItem"></li>
<li class="flc-videoPlayer-languageNone flc-videoPlayer-menuItem fl-videoPlayer-menuItem"></li>
View
4 tests/html/MenuButton-test.html
@@ -31,9 +31,7 @@ <h2 id="qunit-userAgent"></h2>
<div id="qunit-fixture">
<div id="basic-languageControls-test">
- <button type="button" class="flc-videoPlayer-languageButton">
- <span class="flc-videoPlayer-languageButton-label fl-hidden-accessible"></span>
- </button>
+ <button type="button" class="flc-videoPlayer-languageButton"></button>
<ul id="basic-menu-test" class="flc-videoPlayer-languageMenu">
<li class="flc-videoPlayer-language flc-videoPlayer-menuItem fl-videoPlayer-menuItem"></li>
<li class="flc-videoPlayer-languageNone flc-videoPlayer-menuItem fl-videoPlayer-menuItem"></li>
View
10 tests/html/ToggleButton-test.html
@@ -31,15 +31,7 @@ <h2 id="qunit-userAgent"></h2>
<div id="qunit-fixture">
<div id="basic-toggle-button-test">
- <button type="button" class="test-toggle-button">
- <span class="flc-videoPlayer-button-label fl-hidden-accessible"></span>
- </button>
- </div>
-
- <div id="custom-selector-test">
- <button type="button" class="test-toggle-button">
- <span class="special-selector fl-hidden-accessible"></span>
- </button>
+ <button type="button" class="test-toggle-button"></button>
</div>
</div> <!-- /main -->
View
6 tests/js/MenuButtonTests.js
@@ -180,6 +180,7 @@ fluid.registerNamespace("fluid.tests");
jqUnit.expect(10);
var langList = that.menu.locate("language");
var showHide = $(that.menu.locate("showHide")[0]);
+ var button = that.locate("button");
var verifyLanguageState = function (expectedShowText, expectedShowHideFlag) {
jqUnit.expect(2);
jqUnit.assertEquals("The 'show language' model flag should be " + expectedShowHideFlag, expectedShowHideFlag, fluid.get(that.model, that.options.showHidePath));
@@ -190,12 +191,11 @@ fluid.registerNamespace("fluid.tests");
jqUnit.notVisible("Menu should not be visible initially", that.menu.container);
verifyLanguageState(that.options.strings.showLanguage, false);
- jqUnit.assertEquals("Button should have default text", that.button.options.strings.press, that.button.locate("label").text());
- var button = $(that.locate("button")[0]);
+ jqUnit.assertEquals("Button should have default aria-label", that.button.options.strings.press, button.attr("aria-label"));
button.click();
jqUnit.isVisible("Clicking the button should show menu", that.menu.container);
jqUnit.assertTrue("Buttons state should be released", that.button.model.pressed);
- jqUnit.assertEquals("Button should have pressed text", that.button.options.strings.release, that.button.locate("label").text());
+ jqUnit.assertEquals("Button should have pressed aria-label", that.button.options.strings.release, button.attr("aria-label"));
button.click();
jqUnit.notVisible("Clicking the button again should hide menu again", that.menu.container);
View
25 tests/js/ToggleButtonTests.js
@@ -161,33 +161,14 @@ fluid.registerNamespace("fluid.tests");
toggleButtonTests.asyncTest("Label text", function () {
jqUnit.expect(2);
- testComponent = fluid.tests.initToggleButton("#basic-toggle-button-test", {
- listeners: {
- onReady: function (that) {
- jqUnit.assertEquals("Content should contain press label text", that.options.strings.press, that.locate("label").text());
- that.locate("button").click();
- },
- onPress: function (that) {
- jqUnit.assertEquals("Content should contain release label text", that.options.strings.release, that.locate("label").text());
- start();
- }
- }
- });
- });
-
- toggleButtonTests.asyncTest("Label text: custom selector", function () {
- jqUnit.expect(2);
- testComponent = fluid.tests.initToggleButton("#custom-selector-test", {
- selectors: {
- label: ".special-selector"
- },
+ fluid.tests.initToggleButton("#basic-toggle-button-test", {
listeners: {
onReady: function (that) {
- jqUnit.assertEquals("Content should contain press label text", that.options.strings.press, that.locate("label").text());
+ jqUnit.assertEquals("Content should contain press label text", that.options.strings.press, that.locate("button").attr("aria-label"));
that.locate("button").click();
},
onPress: function (that) {
- jqUnit.assertEquals("Content should contain release label text", that.options.strings.release, that.locate("label").text());
+ jqUnit.assertEquals("Content should contain release label text", that.options.strings.release, that.locate("button").attr("aria-label"));
start();
}
}

0 comments on commit a04184c

Please sign in to comment.
Something went wrong with that request. Please try again.