diff --git a/src/lib/viewers/controls/settings/SettingsToggle.tsx b/src/lib/viewers/controls/settings/SettingsToggle.tsx index 257e055d0..5f68a7a9a 100644 --- a/src/lib/viewers/controls/settings/SettingsToggle.tsx +++ b/src/lib/viewers/controls/settings/SettingsToggle.tsx @@ -22,8 +22,8 @@ function SettingsToggle({ badge, isOpen, onClick }: Props, ref: React.Ref): type="button" > + {React.isValidElement(badge) &&
{badge}
} - {React.isValidElement(badge) &&
{badge}
} ); } diff --git a/src/lib/viewers/controls/settings/__tests__/SettingsToggle-test.tsx b/src/lib/viewers/controls/settings/__tests__/SettingsToggle-test.tsx index 1b3fb85fb..c986e0ad2 100644 --- a/src/lib/viewers/controls/settings/__tests__/SettingsToggle-test.tsx +++ b/src/lib/viewers/controls/settings/__tests__/SettingsToggle-test.tsx @@ -21,5 +21,12 @@ describe('SettingsToggle', () => { expect(wrapper.hasClass('bp-is-open')).toBe(isOpen); }); + + test('should render badge if provided', () => { + const Badge = (): JSX.Element =>
Badge
; + const wrapper = getWrapper({ badge: }); + + expect(wrapper.exists(Badge)).toBe(true); + }); }); }); diff --git a/test/integration/media/DashViewer.e2e.test.js b/test/integration/media/DashViewer.e2e.test.js index c46173cf8..b2f003582 100644 --- a/test/integration/media/DashViewer.e2e.test.js +++ b/test/integration/media/DashViewer.e2e.test.js @@ -20,7 +20,7 @@ describe('Dash Viewer', () => { cy.showMediaControls(); // Open the menu - cy.getByTitle('Settings').click({ force: true }); + cy.getByTitle('Settings').click(); }); runBaseMediaSettingsTests(); @@ -42,7 +42,7 @@ describe('Dash Viewer', () => { cy.showMediaControls(); // Open the menu - cy.getByTitle('Settings').click({ force: true }); + cy.getByTitle('Settings').click(); }); runBaseMediaSettingsTests(); diff --git a/test/integration/media/MP3Viewer.e2e.test.js b/test/integration/media/MP3Viewer.e2e.test.js index a87ac7f30..81dd0e4e2 100644 --- a/test/integration/media/MP3Viewer.e2e.test.js +++ b/test/integration/media/MP3Viewer.e2e.test.js @@ -15,7 +15,7 @@ describe('MP3 Viewer', () => { cy.showMediaControls(); // Open the menu - cy.getByTitle('Settings').click({ force: true }); + cy.getByTitle('Settings').click(); }); runBaseMediaSettingsTests(); @@ -31,7 +31,7 @@ describe('MP3 Viewer', () => { cy.showMediaControls(); // Open the menu - cy.getByTitle('Settings').click({ force: true }); + cy.getByTitle('Settings').click(); }); runBaseMediaSettingsTests(); diff --git a/test/integration/media/MP4Viewer.e2e.test.js b/test/integration/media/MP4Viewer.e2e.test.js index 04a4acbe8..aa5e3146e 100644 --- a/test/integration/media/MP4Viewer.e2e.test.js +++ b/test/integration/media/MP4Viewer.e2e.test.js @@ -15,7 +15,7 @@ describe('MP4 Viewer', () => { cy.showMediaControls(); // Open the menu - cy.getByTitle('Settings').click({ force: true }); + cy.getByTitle('Settings').click(); }); runBaseMediaSettingsTests(); @@ -31,7 +31,7 @@ describe('MP4 Viewer', () => { cy.showMediaControls(); // Open the menu - cy.getByTitle('Settings').click({ force: true }); + cy.getByTitle('Settings').click(); }); runBaseMediaSettingsTests(); diff --git a/test/integration/media/Video360Viewer.e2e.test.js b/test/integration/media/Video360Viewer.e2e.test.js index a836642a7..e5904f316 100644 --- a/test/integration/media/Video360Viewer.e2e.test.js +++ b/test/integration/media/Video360Viewer.e2e.test.js @@ -15,7 +15,7 @@ describe('Video360 Viewer', () => { cy.showMediaControls(); // Open the menu - cy.getByTitle('Settings').click({ force: true }); + cy.getByTitle('Settings').click(); }); runBaseMediaSettingsTests(); diff --git a/test/support/mediaSettingsTests.js b/test/support/mediaSettingsTests.js index 33dc44632..754dcbbcf 100644 --- a/test/support/mediaSettingsTests.js +++ b/test/support/mediaSettingsTests.js @@ -6,7 +6,7 @@ export function runBaseMediaSettingsTests() { cy.getByTestId('bp-media-settings-speed').contains('Normal'); // Close the menu - cy.getByTitle('Settings').click({ force: true }); + cy.getByTitle('Settings').click(); cy.getByTestId('bp-settings-flyout').should('not.be.visible'); });