Skip to content

Commit

Permalink
增加新的测试用例
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Feb 22, 2024
1 parent fc84bb5 commit b67b70e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/provider/src/typing/layoutToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type BaseLayoutDesignToken = {
/**
* layout 的背景颜色
*/
bgLayout: string;
bgLayout: string | null;

/**
* 侧边side的 token 配置
Expand Down
20 changes: 20 additions & 0 deletions tests/layout/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,26 @@ describe('BasicLayout', () => {
});
});

it('🥩 do not render bgListDom', async () => {
const wrapper = render(
<ProLayout
token={{
bgLayout: null,
}}
menuExtraRender={() => <div>menuExtraRender</div>}
menuHeaderRender={false}
/>,
);
await waitForWaitTime(100);
const dom = wrapper.baseElement.querySelector<HTMLDivElement>(
'.ant-pro-layout-bg-list',
);
expect(!!dom).toBeFalsy();
act(() => {
wrapper.unmount();
});
});

it('🥩 customize render menu header', async () => {
const wrapper = render(
<ProLayout
Expand Down

0 comments on commit b67b70e

Please sign in to comment.