-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #824 from oceanbase/dengfuping-dev
improve(design): ConfigProvider add appProps to control .ant-app style work
- Loading branch information
Showing
4 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
packages/design/src/config-provider/__tests__/__snapshots__/appProps.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`ConfigProvider appProps > ConfigProvider styleProviderProps.component 1`] = ` | ||
<DocumentFragment> | ||
<div> | ||
Child 1 | ||
</div> | ||
<div | ||
class="ant-app" | ||
> | ||
<div> | ||
Child 2 | ||
</div> | ||
</div> | ||
</DocumentFragment> | ||
`; |
17 changes: 17 additions & 0 deletions
17
packages/design/src/config-provider/__tests__/appProps.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import { ConfigProvider } from '@oceanbase/design'; | ||
|
||
describe('ConfigProvider appProps', () => { | ||
it('ConfigProvider styleProviderProps.component', () => { | ||
const { asFragment } = render( | ||
<ConfigProvider> | ||
<div>Child 1</div> | ||
<ConfigProvider appProps={{ component: 'div' }}> | ||
<div>Child 2</div> | ||
</ConfigProvider> | ||
</ConfigProvider> | ||
); | ||
expect(asFragment()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters