Ensure FullScreen button has classname set on render.

When the FullScreen icon is first rendered, the button within it is not having the inactive classname set. The class name is set on toggling fullscreen on/off - just not being set on render.
This commit is contained in:
Alan Moffat
2022-03-04 11:13:00 +00:00
parent 0c23e17e13
commit 87d87a155a
2 changed files with 20 additions and 0 deletions

View File

@@ -7,4 +7,23 @@ describe('ol.control.FullScreen', function () {
expect(instance).to.be.an(FullScreen);
});
});
describe('the fullscreen button', function () {
describe('when inactiveClassName is not set', function () {
it('is created with the default inactive classname set on the button', function () {
const instance = new FullScreen();
const button = instance.button_;
expect(button.className).to.equal('ol-full-screen-false');
});
});
describe('when inactiveClassName is set', function () {
it('is created with the desired inactive classnames set on the button', function () {
const instance = new FullScreen({
inactiveClassName: 'foo bar',
});
const button = instance.button_;
expect(button.className).to.equal('foo bar');
});
});
});
});