| <script src="../../../resources/js-test-pre.js"></script> |
| <script src="../resources/media-controls-loader.js" type="text/javascript"></script> |
| <body> |
| <script type="text/javascript"> |
| |
| description("Testing the <code>ButtonsContainer</code> constructor."); |
| |
| const defaultContainer = new ButtonsContainer; |
| shouldBeEqualToString("defaultContainer.element.localName", "div"); |
| shouldBeEqualToString("defaultContainer.element.className.trim()", "buttons-container"); |
| shouldBe("defaultContainer.buttonMargin", "16"); |
| shouldBe("defaultContainer.leftMargin", "16"); |
| shouldBe("defaultContainer.rightMargin", "16"); |
| shouldBe("defaultContainer.children", "[]"); |
| |
| const buttons = [new Button, new Button]; |
| const containerWithParameters = new ButtonsContainer({ |
| buttonMargin: 10, |
| leftMargin: 20, |
| rightMargin: 20, |
| children: buttons, |
| cssClassName: "foo" |
| }); |
| shouldBeEqualToString("containerWithParameters.element.localName", "div"); |
| shouldBeTrue("containerWithParameters.element.classList.contains('buttons-container')"); |
| shouldBeTrue("containerWithParameters.element.classList.contains('foo')"); |
| shouldBe("containerWithParameters.buttonMargin", "10"); |
| shouldBe("containerWithParameters.leftMargin", "20"); |
| shouldBe("containerWithParameters.rightMargin", "20"); |
| shouldBe("containerWithParameters.children", "buttons"); |
| |
| </script> |
| <script src="../../../resources/js-test-post.js"></script> |
| </body> |