Skip to content

Commit

Permalink
更新单测
Browse files Browse the repository at this point in the history
  • Loading branch information
qkiroc committed Feb 19, 2025
1 parent 93eb9ab commit d4e7252
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 46 deletions.
8 changes: 5 additions & 3 deletions packages/amis/__tests__/renderers/QRCode.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ describe('Renderer:qr-code', () => {
mode: 'svg'
});

expect(svgEl?.firstElementChild?.getAttribute('fill')).toBe('#108cee');
expect(svgEl?.lastElementChild?.getAttribute('fill')).toBe('yellow');
expect(svgEl?.getAttribute('style')).toBe(
'background-color: rgb(16, 140, 238);'
);
expect(svgEl?.firstElementChild?.getAttribute('fill')).toBe('yellow');
expect(container).toMatchSnapshot();
});

Expand All @@ -70,7 +72,7 @@ describe('Renderer:qr-code', () => {
y: 30
}
});
const imageEl = svgEl?.lastElementChild;
const imageEl = svgEl?.querySelector('image');

expect(imageEl).not.toBeNull();
expect(imageEl?.getAttribute('xlink:href')).not.toBeUndefined();
Expand Down
Loading

0 comments on commit d4e7252

Please sign in to comment.