mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-27 12:51:26 +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
|
||||
data-testid="input-number"
|
||||
placeholder="请输入维度大小"
|
||||
style="flex: 1 1 0%;"
|
||||
style="flex: 1;"
|
||||
type="number"
|
||||
value="1536"
|
||||
/>
|
||||
@ -43,7 +43,7 @@ exports[`InputEmbeddingDimension > basic rendering > should match snapshot with
|
||||
<input
|
||||
data-testid="input-number"
|
||||
placeholder="请输入维度大小"
|
||||
style="flex: 1 1 0%;"
|
||||
style="flex: 1;"
|
||||
type="number"
|
||||
value=""
|
||||
/>
|
||||
|
||||
@ -24,7 +24,6 @@ exports[`Spinner > should match snapshot 1`] = `
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
style="color: unset;"
|
||||
viewBox="0 0 24 24"
|
||||
width="16"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
||||
@ -58,6 +58,12 @@ vi.mock('@renderer/hooks/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', () => ({
|
||||
CodeBlockView: mocks.CodeBlockView,
|
||||
HtmlArtifactsCard: mocks.HtmlArtifactsCard
|
||||
|
||||
@ -2,15 +2,19 @@
|
||||
|
||||
exports[`CodeBlock > rendering > should render a snapshot 1`] = `
|
||||
<div>
|
||||
<div>
|
||||
<code>
|
||||
console.log("hello world")
|
||||
</code>
|
||||
<button
|
||||
type="button"
|
||||
>
|
||||
Save
|
||||
</button>
|
||||
<div
|
||||
class="relative"
|
||||
>
|
||||
<div>
|
||||
<code>
|
||||
console.log("hello world")
|
||||
</code>
|
||||
<button
|
||||
type="button"
|
||||
>
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user