mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-09 06:49:02 +08:00
test: update snapshots and add mock for ui components
Update test snapshots to reflect changes in component styling and structure Add mock for @cherrystudio/ui components in CodeBlock tests
This commit is contained in:
parent
e69260defa
commit
b8a8f19892
@ -8,7 +8,7 @@ exports[`InputEmbeddingDimension > basic rendering > should match snapshot with
|
|||||||
<input
|
<input
|
||||||
data-testid="input-number"
|
data-testid="input-number"
|
||||||
placeholder="请输入维度大小"
|
placeholder="请输入维度大小"
|
||||||
style="flex: 1 1 0%;"
|
style="flex: 1;"
|
||||||
type="number"
|
type="number"
|
||||||
value="1536"
|
value="1536"
|
||||||
/>
|
/>
|
||||||
@ -43,7 +43,7 @@ exports[`InputEmbeddingDimension > basic rendering > should match snapshot with
|
|||||||
<input
|
<input
|
||||||
data-testid="input-number"
|
data-testid="input-number"
|
||||||
placeholder="请输入维度大小"
|
placeholder="请输入维度大小"
|
||||||
style="flex: 1 1 0%;"
|
style="flex: 1;"
|
||||||
type="number"
|
type="number"
|
||||||
value=""
|
value=""
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -24,7 +24,6 @@ exports[`Spinner > should match snapshot 1`] = `
|
|||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
stroke-width="2"
|
stroke-width="2"
|
||||||
style="color: unset;"
|
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
width="16"
|
width="16"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
|||||||
@ -58,6 +58,12 @@ vi.mock('@renderer/hooks/useSettings', () => ({
|
|||||||
useSettings: () => mocks.useSettings()
|
useSettings: () => mocks.useSettings()
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
vi.mock('@cherrystudio/ui', () => ({
|
||||||
|
cn: vi.fn((...classes) => classes.filter(Boolean).join(' ')),
|
||||||
|
Spinner: vi.fn(() => <div data-testid="spinner" />),
|
||||||
|
BlockingOverlay: vi.fn(({ children }) => <div>{children}</div>)
|
||||||
|
}))
|
||||||
|
|
||||||
vi.mock('@renderer/components/CodeBlockView', () => ({
|
vi.mock('@renderer/components/CodeBlockView', () => ({
|
||||||
CodeBlockView: mocks.CodeBlockView,
|
CodeBlockView: mocks.CodeBlockView,
|
||||||
HtmlArtifactsCard: mocks.HtmlArtifactsCard
|
HtmlArtifactsCard: mocks.HtmlArtifactsCard
|
||||||
|
|||||||
@ -2,15 +2,19 @@
|
|||||||
|
|
||||||
exports[`CodeBlock > rendering > should render a snapshot 1`] = `
|
exports[`CodeBlock > rendering > should render a snapshot 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div
|
||||||
<code>
|
class="relative"
|
||||||
console.log("hello world")
|
>
|
||||||
</code>
|
<div>
|
||||||
<button
|
<code>
|
||||||
type="button"
|
console.log("hello world")
|
||||||
>
|
</code>
|
||||||
Save
|
<button
|
||||||
</button>
|
type="button"
|
||||||
|
>
|
||||||
|
Save
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user