Skip to content

Commit

Permalink
chore: Go with option 1 - update dev page
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuelz authored and just-boris committed Nov 1, 2024
1 parent 323a0b6 commit dbf7d20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
1 change: 0 additions & 1 deletion pages/app-layout/utils/external-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ awsuiPlugins.appLayout.registerDrawer({
},

mountContent: container => {
// Option 2 to make tests pass
ReactDOM.render(<div>Nothing to see here</div>, container);
},
unmountContent: container => unmountComponentAtNode(container),
Expand Down
16 changes: 3 additions & 13 deletions src/app-layout/__integ__/runtime-drawers-controllability.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,12 @@ import createWrapper from '../../../lib/components/test-utils/selectors';

const wrapper = createWrapper().findAppLayout();

class AppLayoutDrawerControllabilityPage extends BasePageObject {
// Option 3 to make tests pass
getActiveDrawerText() {
const drawerSelector = wrapper.findActiveDrawer().toSelector();
return this.browser.execute(drawerSelector => {
return document.querySelector(drawerSelector)!.textContent;
}, drawerSelector);
}
}

describe.each(['classic', 'refresh', 'refresh-toolbar'] as const)('%s', theme => {
for (const pageName of ['runtime-drawers', 'runtime-drawers-imperative']) {
describe(`page=${pageName}`, () => {
function setupTest(testFn: (page: AppLayoutDrawerControllabilityPage) => Promise<void>) {
function setupTest(testFn: (page: BasePageObject) => Promise<void>) {
return useBrowser(async browser => {
const page = new AppLayoutDrawerControllabilityPage(browser);
const page = new BasePageObject(browser);

await browser.url(
`#/light/app-layout/${pageName}?${new URLSearchParams({
Expand Down Expand Up @@ -65,7 +55,7 @@ describe.each(['classic', 'refresh', 'refresh-toolbar'] as const)('%s', theme =>
);
await page.click(wrapper.findDrawerTriggerById('circle').toSelector());
await expect(page.isDisplayed(wrapper.findToolsClose().toSelector())).resolves.toBeFalsy();
await expect(page.getActiveDrawerText()).resolves.toContain('Nothing to see here');
await expect(page.getText(wrapper.findActiveDrawer().getElement())).resolves.toContain('Nothing to see here');
})
);

Expand Down

0 comments on commit dbf7d20

Please sign in to comment.