Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 6 additions & 17 deletions pages/app/app-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,30 +105,19 @@ function formatQuery(params: AppUrlParams) {
export function AppContextProvider({ children }: { children: React.ReactNode }) {
const history = useHistory();
const location = useLocation();
const matchWithVisualMode = useRouteMatch<{ mode: Mode; pageId: string }>('/:mode(light|dark)/:pageId*');
const matchWithoutVisualMode = useRouteMatch<{ pageId: string }>('/:pageId*');
const pageId = (matchWithVisualMode ?? matchWithoutVisualMode)?.params.pageId ?? undefined;
const match = useRouteMatch<{ pageId: string }>('/:pageId*');
const pageId = match?.params.pageId ?? undefined;
const urlParams = parseQuery(location.search) as AppUrlParams;
const mode = matchWithVisualMode?.params.mode ?? urlParams.mode ?? Mode.Light;
const mode = urlParams.mode ?? Mode.Light;

function setUrlParams(newParams: Partial<AppUrlParams>) {
const formattedQuery = formatQuery({ ...urlParams, ...newParams });
if (matchWithVisualMode) {
const pathname = [matchWithVisualMode.params.mode, pageId].filter(segment => !!segment).join('/') + '/';
history.replace(`/${pathname}${formatQuery({ ...urlParams, ...newParams })}`);
} else {
const newUrl = pageId ? `/${pageId}${formattedQuery}` : formattedQuery;
history.replace(newUrl);
}
const newUrl = pageId ? `/${pageId}${formattedQuery}` : formattedQuery;
history.replace(newUrl);
}

function updateMode(newMode: Mode) {
if (matchWithVisualMode) {
const pathname = [newMode, pageId].filter(segment => !!segment).join('/') + '/';
history.replace('/' + pathname + location.search + location.hash);
} else {
setUrlParams({ mode: newMode });
}
setUrlParams({ mode: newMode });
}

return (
Expand Down
4 changes: 2 additions & 2 deletions pages/app/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import ThemeSwitcher from './theme-switcher';
import styles from './header.scss';

export default function Header({ sticky }: { sticky?: boolean }) {
const { mode } = useContext(AppContext);
const { urlParams } = useContext(AppContext);
return (
<>
{/* #h selector for compatibility with global navigation */}
<header id="h" className={clsx(styles.header, sticky && styles['header-sticky'])}>
<Link to={`/${mode}/`}>Demo Assets</Link>
<Link to={{ pathname: '/', search: urlParams.mode ? `?mode=${urlParams.mode}` : '' }}>Demo Assets</Link>
<ThemeSwitcher />
</header>
</>
Expand Down
9 changes: 7 additions & 2 deletions pages/app/components/index-page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import React from 'react';
import React, { useContext } from 'react';
import { Link } from 'react-router-dom';

import { PACKAGE_VERSION } from '~components/internal/environment';
import AwsUiLink from '~components/link';

import AppContext from '../app-context';
import pagesContext from '../pages-context';

interface TreeItem {
Expand Down Expand Up @@ -38,10 +39,14 @@ function createPagesTree(pages: string[]) {
}

function TreeItemView({ item }: { item: TreeItem }) {
const { urlParams } = useContext(AppContext);
return (
<li>
{item.href ? (
<Link to={item.href} component={AwsUiLink}>
<Link
to={{ pathname: item.href, search: urlParams.mode ? `?mode=${urlParams.mode}` : '' }}
component={AwsUiLink}
>
{item.name}
</Link>
) : (
Expand Down
2 changes: 1 addition & 1 deletion pages/button-dropdown/custom-render-item.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const itemsWithGroups: ButtonDropdownProps['items'] = [
secondaryText: '',
labelTag: 'Ctrl + P',
external: true,
href: '/#/light/',
href: '/#/',
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion pages/button-dropdown/simple.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const withExpandedGroups: ButtonDropdownProps['items'] = [
secondaryText: '',
labelTag: 'Ctrl + P',
external: true,
href: '/#/light/',
href: '/#/',
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion pages/error-boundary/demo-components.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export default function () {
columnDefinitions={[
{
header: 'Column 1',
cell: item => <Link href="/#/light/error-boundary/demo-async-load">{item}</Link>,
cell: item => <Link href="/#/error-boundary/demo-async-load">{item}</Link>,
},
{ header: 'Column 2', cell: item => `Content 2:${item}` },
{ header: 'Column 3', cell: item => `Content 3:${item}` },
Expand Down
2 changes: 1 addition & 1 deletion src/__a11y__/a11y-app-layout-toolbar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('A11y checks for app layout toolbar', () => {
findAllPages()
.filter(page => page.startsWith('app-layout') && !EXCLUDED_PAGES.includes(page))
.forEach(inputUrl => {
const url = `#/light/${inputUrl}?${getUrlParams('refresh-toolbar')}`;
const url = `#/${inputUrl}?${getUrlParams('refresh-toolbar')}`;
test(
`${url}`,
useBrowser(async browser => {
Expand Down
2 changes: 1 addition & 1 deletion src/__a11y__/misc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test(
'undefined texts finder works',
useBrowser(async browser => {
const page = new A11yPageObject(browser);
await browser.url('#/dark/undefined-texts');
await browser.url('#/undefined-texts?mode=dark');
await page.waitForVisible('main');
await expect(page.getUndefinedTexts()).resolves.toEqual([
'This page contains undefined strings',
Expand Down
2 changes: 1 addition & 1 deletion src/__integ__/screenshot-area.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test(
'shows warning message when the page height exceeds the limit and hides when it does not',
useBrowser(async browser => {
const page = new ScreenshotAreaPage(browser);
await browser.url('#light/utils/screenshot-area-warning');
await browser.url('#/utils/screenshot-area-warning');
await page.waitForVisible('.screenshot-area');
await expect(page.isWarningDisplayed()).resolves.toBe(false);
await page.clickAddItems();
Expand Down
16 changes: 8 additions & 8 deletions src/__integ__/themes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ class CustomPropertyPageObject extends BasePageObject {

describe('CSS Custom Properties', () => {
test.each<[string, string, string?]>([
['light', '#light/?visualRefresh=false'],
['dark', '#dark/?visualRefresh=false'],
['compact', '#light/?visualRefresh=false&density=compact'],
['light', '#/?visualRefresh=false'],
['dark', '#/?mode=dark&visualRefresh=false'],
['compact', '#/?visualRefresh=false&density=compact'],
// use motionDisabled to force design tokens into expected values
['reduced-motion', '#light/?visualRefresh=false&motionDisabled=true'],
['visual-refresh', '#light/?visualRefresh=true'],
['visual-refresh-dark', '#dark/?visualRefresh=true'],
['visual-refresh-compact', '#light/?visualRefresh=true&density=compact'],
['reduced-motion', '#/?visualRefresh=false&motionDisabled=true'],
['visual-refresh', '#/?visualRefresh=true'],
['visual-refresh-dark', '#/?mode=dark&visualRefresh=true'],
['visual-refresh-compact', '#/?visualRefresh=true&density=compact'],
[
'visual-refresh-content-header',
'#/light/visual-contexts/content-header/?visualRefresh=true',
'#/visual-contexts/content-header/?visualRefresh=true',
'.awsui-context-content-header',
],
])('match previous snapshot for mode %p', (_, url, selector = 'body') =>
Expand Down
2 changes: 1 addition & 1 deletion src/__integ__/toggles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Object.keys(wrappers).forEach(componentName => {
function setupTest(testFn: (page: BasePageObject) => Promise<void>) {
return useBrowser(async browser => {
const page = new BasePageObject(browser);
await browser.url(`#light/${componentName}/focus-test`);
await browser.url(`#/${componentName}/focus-test`);
await testFn(page);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/alert/__integ__/persistence-integ.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const setupTest = (
if (params.dismissedKeys !== undefined) {
urlParams.set('dismissedKeys', params.dismissedKeys);
}
const url = `#/light/alert/persistence${urlParams.toString() ? '?' + urlParams.toString() : ''}`;
const url = `#/alert/persistence${urlParams.toString() ? '?' + urlParams.toString() : ''}`;
await browser.url(url);
await page.waitForVisible(wrapper.findAlert().toSelector());
await testFn(page);
Expand Down
2 changes: 1 addition & 1 deletion src/alert/__integ__/runtime-content.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class RuntimeContentPage extends BasePageObject {
function setupTest(testFn: (page: RuntimeContentPage) => Promise<void>) {
return useBrowser(async browser => {
const page = new RuntimeContentPage(browser);
await browser.url('#/light/alert/runtime-content/?autofocus=true');
await browser.url('#/alert/runtime-content/?autofocus=true');
await page.waitForVisible('.screenshot-area');
await testFn(page);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('AnchorNavigation', () => {
function setupTest(testFn: (page: AnchorNavigationPage) => Promise<void>) {
return useBrowser(async browser => {
const page = new AnchorNavigationPage(browser);
await browser.url('#/light/anchor-navigation/basic');
await browser.url('#/anchor-navigation/basic');
await page.waitForVisible(wrapper.toSelector());
await testFn(page);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const annotationWrapper = wrapper.findAnnotation();
function setupTest(testFn: (page: BasePageObject) => Promise<void>) {
return useBrowser(async browser => {
const page = new BasePageObject(browser);
await browser.url('#/light/annotation-context/annotation-scroll');
await browser.url('#/annotation-context/annotation-scroll');
await testFn(page);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/annotation-context/__integ__/switching-pages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const annotationWrapper = wrapper.findAnnotation();
test(
'should open a next hotspot on a next page after loading',
useBrowser(async browser => {
await browser.url('#/light/annotation-context/with-switching-pages');
await browser.url('#/annotation-context/with-switching-pages');
const page = new BasePageObject(browser);
await page.click(annotationWrapper.findNextButton().toSelector());
await page.click('[data-testid="next-page"]');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Multi page layout navigation', () => {
const setupTest = (testFn: (page: PageObject) => Promise<void>) =>
useBrowser(async browser => {
const page = new PageObject(browser);
await browser.url('#/light/app-layout-toolbar/multi-layout-with-hidden-instances');
await browser.url('#/app-layout-toolbar/multi-layout-with-hidden-instances');
await testFn(page);
});

Expand Down
2 changes: 1 addition & 1 deletion src/app-layout/__integ__/ai-drawer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Visual refresh toolbar only', () => {
const page = new PageObject(browser);

await browser.url(
`#/light/app-layout/sidecar-demo?${getUrlParams('refresh-toolbar', {
`#/app-layout/sidecar-demo?${getUrlParams('refresh-toolbar', {
hasDrawers: 'false',
hasTools: 'true',
splitPanelPosition: 'side',
Expand Down
2 changes: 1 addition & 1 deletion src/app-layout/__integ__/app-layout-drawers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
disableContentPaddings,
appLayoutToolbar: `${theme === 'refresh-toolbar'}`,
}).toString();
await browser.url(`#/light/app-layout/with-drawers?${params}`);
await browser.url(`#/app-layout/with-drawers?${params}`);
await page.waitForVisible(wrapper.findContentRegion().toSelector());
await testFn(page);
});
Expand All @@ -120,7 +120,7 @@
['refresh-toolbar']: 1,
};

test(

Check warning on line 123 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 18, shard 4/4)

RETRY 1: refresh › desktop › slider is accessible by keyboard in side position

thrown: "Exceeded timeout of 60000 ms for a test. Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout." at src/app-layout/__integ__/app-layout-drawers.test.ts:123:5 at src/app-layout/__integ__/app-layout-drawers.test.ts:116:3 at Array.forEach (<anonymous>) at Object.<anonymous> (src/app-layout/__integ__/app-layout-drawers.test.ts:115:55)
'slider is accessible by keyboard in side position',
setupTest({ theme }, async page => {
await page.openFirstDrawer();
Expand Down Expand Up @@ -220,7 +220,7 @@
);

await page.openThirdDrawer(theme === 'refresh-toolbar');
//todo: resolve split panel positioning change on large drawer openeing

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / build (React 18) / build

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / build / build

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Build components

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Build components (React 18)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (1/6)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components unit tests

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (4/6)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components motion tests (React 16)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components motion tests (React 18)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 18, shard 1/4)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 18, shard 3/4)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 18, shard 2/4)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 16, shard 4/4)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 16, shard 3/4)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 16, shard 1/4)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 16, shard 2/4)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (3/6)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (6/6)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (2/6)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (5/6)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 223 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 18, shard 4/4)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'
const expectedSplitPanelSelector =
theme === 'refresh-toolbar'
? wrapper.findSplitPanel().findOpenPanelSide().toSelector()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('Visual refresh toolbar only', () => {
const page = new PageObject(browser);

await browser.url(
`#/light/app-layout/with-error-boundaries?${getUrlParams('refresh-toolbar', {
`#/app-layout/with-error-boundaries?${getUrlParams('refresh-toolbar', {
appLayoutToolbar: 'true',
hasParentErrorBoundary,
})}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
: {}
);
await page.setWindowSize(mobile ? viewports.mobile : viewports.desktop);
await browser.url(`#/light/app-layout/${pageName}?${params}`);
await browser.url(`#/app-layout/${pageName}?${params}`);
await page.waitForVisible(wrapper.findContentRegion().toSelector());
await testFn(page);
});
Expand Down Expand Up @@ -189,7 +189,7 @@
)
);

//todo - investigate why resize observer throwing error only on mobile in tests

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / build (React 18) / build

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / build / build

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Build components

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Build components (React 18)

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (1/6)

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components unit tests

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (4/6)

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components motion tests (React 16)

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components motion tests (React 18)

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 18, shard 1/4)

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 18, shard 3/4)

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 18, shard 2/4)

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 16, shard 4/4)

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 16, shard 3/4)

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 16, shard 1/4)

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 16, shard 2/4)

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (3/6)

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (6/6)

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (2/6)

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (5/6)

Unexpected 'todo' comment: 'todo - investigate why resize observer...'

Check warning on line 192 in src/app-layout/__integ__/app-layout-focus-delegation.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 18, shard 4/4)

Unexpected 'todo' comment: 'todo - investigate why resize observer...'
testIf(!mobile)(
'does not focus split panel when opening programatically',
setupTest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe.each(['refresh', 'refresh-toolbar'] as Theme[])('%s', theme => {
return useBrowser(async browser => {
const page = new AppLayoutRefreshNotoficationsPage(browser);
await page.setWindowSize({ ...viewports.desktop, width: viewportWidth });
await browser.url(`#/light/app-layout/refresh-content-width/?${getUrlParams(theme)}`);
await browser.url(`#/app-layout/refresh-content-width/?${getUrlParams(theme)}`);
await page.waitForVisible(wrapper.findContentRegion().toSelector());
await testFn(page);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe.each(['refresh', 'refresh-toolbar'] as Theme[])('%s', theme => {
return useBrowser(async browser => {
const page = new AppLayoutRefreshEdgeControlsPage(browser);
await page.setWindowSize(viewports.desktop);
await browser.url(`#/light/app-layout/disable-paddings-edge-controls/?${getUrlParams(theme)}`);
await browser.url(`#/app-layout/disable-paddings-edge-controls/?${getUrlParams(theme)}`);
await page.waitForVisible(wrapper.findContentRegion().toSelector());
await testFn(page);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe.each(['refresh', 'refresh-toolbar'] as Theme[])('%s', theme => {
const page = new AppLayoutRefreshNotoficationsPage(browser);
await page.setWindowSize(viewport);
await browser.url(
`#/light/app-layout/notifications-refresh/?${getUrlParams(theme)}${removeNotifications ? `&removeNotifications` : ''}`
`#/app-layout/notifications-refresh/?${getUrlParams(theme)}${removeNotifications ? `&removeNotifications` : ''}`
);
await page.waitForVisible(wrapper.findContentRegion().toSelector());
await testFn(page);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const setupTest = (
const page = new AppLayoutSplitViewPage(browser);
await page.setWindowSize({ ...viewports.desktop, width: initialViewportWidth });

const url = `#/light/app-layout/with-split-panel-and-body-scroll?${params.toString()}`;
const url = `#/app-layout/with-split-panel-and-body-scroll?${params.toString()}`;

await browser.url(url);
const content = createWrapper().findAppLayout().findContentRegion();
Expand Down
19 changes: 8 additions & 11 deletions src/app-layout/__integ__/app-layout-split-panel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ const scrollbarSelector = `.${tableScrollbarStyles['sticky-scrollbar-visible']}`
const wrapper = createWrapper().findAppLayout();

describe.each(['refresh', 'refresh-toolbar'] as const)('%s', theme => {
function setupTest(
testFn: (page: AppLayoutSplitViewPage) => Promise<void>,
url = '#/light/app-layout/with-split-panel'
) {
function setupTest(testFn: (page: AppLayoutSplitViewPage) => Promise<void>, url = '#/app-layout/with-split-panel') {
return useBrowser(async browser => {
const page = new AppLayoutSplitViewPage(browser);
await page.setWindowSize(viewports.desktop);
Expand Down Expand Up @@ -53,15 +50,15 @@ describe.each(['refresh', 'refresh-toolbar'] as const)('%s', theme => {
setupTest(async page => {
await page.click('button=Add widget');
await expect(page.isFocused(wrapper.findSplitPanel().findSlider().toSelector())).resolves.toBe(true);
}, '#/light/app-layout/dashboard-content-type')
}, '#/app-layout/dashboard-content-type')
);

test(
'renders with initial side position',
useBrowser(async browser => {
const page = new AppLayoutSplitViewPage(browser);
await page.setWindowSize(viewports.desktop);
await browser.url(`#/light/app-layout/with-split-panel?splitPanelPosition=side`);
await browser.url(`#/app-layout/with-split-panel?splitPanelPosition=side`);
await page.waitForVisible(wrapper.findContentRegion().toSelector());
await page.openPanel();
await expect(page.getPanelPosition()).resolves.toEqual('side');
Expand Down Expand Up @@ -132,8 +129,8 @@ describe.each(['refresh', 'refresh-toolbar'] as const)('%s', theme => {
);

[
{ url: '#/light/app-layout/disable-paddings-with-split-panel', name: 'paddings disabled' },
{ url: '#/light/app-layout/with-split-panel', name: 'paddings enabled' },
{ url: '#/app-layout/disable-paddings-with-split-panel', name: 'paddings disabled' },
{ url: '#/app-layout/with-split-panel', name: 'paddings enabled' },
].forEach(({ url, name }) => {
test(
`should not allow resize split panel beyond min and max limits (side position) (${name})`,
Expand Down Expand Up @@ -253,7 +250,7 @@ describe.each(['refresh', 'refresh-toolbar'] as const)('%s', theme => {
await expect(page.getContentOffsetBottom(theme)).resolves.toEqual(windowHeight / 2 + splitPanelPadding + 'px');
await page.switchPosition('side');
await expect(page.getContentOffsetBottom(theme)).resolves.toEqual(splitPanelPadding + 'px');
}, '#/light/app-layout/with-full-page-table-and-split-panel')
}, '#/app-layout/with-full-page-table-and-split-panel')
);

test(
Expand All @@ -264,7 +261,7 @@ describe.each(['refresh', 'refresh-toolbar'] as const)('%s', theme => {
await page.switchPosition('side');
await page.switchPosition('bottom');
await expect(page.getContentOffsetBottom(theme)).resolves.toEqual(windowHeight / 2 + splitPanelPadding + 'px');
}, '#/light/app-layout/with-full-page-table-and-split-panel')
}, '#/app-layout/with-full-page-table-and-split-panel')
);

test(
Expand All @@ -278,7 +275,7 @@ describe.each(['refresh', 'refresh-toolbar'] as const)('%s', theme => {
page.isDisplayedInViewport(wrapper.findSplitPanel().findOpenPanelBottom().toSelector())
).resolves.toBe(true);
await expect(page.isClickable(scrollbarSelector)).resolves.toBe(true);
}, '#/light/app-layout/with-sticky-table-and-split-panel')
}, '#/app-layout/with-sticky-table-and-split-panel')
);
});
});
Loading
Loading