Skip to content

Commit 7fe0c24

Browse files
committed
fix: broken image links
1 parent bf2646c commit 7fe0c24

File tree

3 files changed

+81
-3
lines changed

3 files changed

+81
-3
lines changed
Lines changed: 34 additions & 0 deletions
Loading
Lines changed: 34 additions & 0 deletions
Loading

test/docs/builtin/markdown-docs.test.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,10 +636,12 @@ describe('markdown-docs generator', () => {
636636
});
637637

638638
describe('brand image copying', () => {
639-
it('copies brand images to <docs_out>/../images/ when source dir exists', async () => {
639+
it('copies brand images (PNG and SVG) to <docs_out>/../images/ when source dir exists', async () => {
640640
mockFs.readdirSync = vi.fn(() => [
641641
'archlette-stainedglassA-light.png',
642642
'archlette-stainedglassA-dark.png',
643+
'archlette-stainedglassA-light.svg',
644+
'archlette-stainedglassA-dark.svg',
643645
]);
644646

645647
await markdownDocs(mockContext);
@@ -649,8 +651,8 @@ describe('markdown-docs generator', () => {
649651
recursive: true,
650652
});
651653

652-
// each image should be copied
653-
expect(mockFs.copyFileSync).toHaveBeenCalledTimes(2);
654+
// all four files (2 PNG + 2 SVG) should be copied
655+
expect(mockFs.copyFileSync).toHaveBeenCalledTimes(4);
654656
expect(mockFs.copyFileSync).toHaveBeenCalledWith(
655657
expect.stringContaining('archlette-stainedglassA-light.png'),
656658
expect.stringContaining('archlette-stainedglassA-light.png'),
@@ -659,6 +661,14 @@ describe('markdown-docs generator', () => {
659661
expect.stringContaining('archlette-stainedglassA-dark.png'),
660662
expect.stringContaining('archlette-stainedglassA-dark.png'),
661663
);
664+
expect(mockFs.copyFileSync).toHaveBeenCalledWith(
665+
expect.stringContaining('archlette-stainedglassA-light.svg'),
666+
expect.stringContaining('archlette-stainedglassA-light.svg'),
667+
);
668+
expect(mockFs.copyFileSync).toHaveBeenCalledWith(
669+
expect.stringContaining('archlette-stainedglassA-dark.svg'),
670+
expect.stringContaining('archlette-stainedglassA-dark.svg'),
671+
);
662672
});
663673

664674
it('copies images to a path one level above docs_out', async () => {

0 commit comments

Comments
 (0)