mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-08 21:47:45 +00:00
e81ab0a5ea
Removes what would block a later switch to Vue's vapor mode: `vue-chartjs` and the `SvgIcon` render function are virtual DOM components, and `v-memo` has no vapor equivalent. This does not adopt vapor mode, which will be stable in upcoming Vue 3.6. `vue-chartjs` was a thin wrapper over chart.js, so a local `ChartCanvas.vue` replaces it. Chart data and options move into computed values to keep their object identity, which is what `v-memo` was compensating for. `chartjs-adapter-dayjs-4` is moved first-party, just ~40 lines that are easy to maintain.
15 lines
507 B
TypeScript
15 lines
507 B
TypeScript
import {svg, svgParseOuterInner} from './svg.ts';
|
|
|
|
test('svg', () => {
|
|
expect(svg('octicon-repo')).toMatch(/^<svg/);
|
|
expect(svg('octicon-repo', 16)).toContain('width="16"');
|
|
expect(svg('octicon-repo', 32)).toContain('width="32"');
|
|
});
|
|
|
|
test('svgParseOuterInner', () => {
|
|
const {svgOuter, svgInnerHtml} = svgParseOuterInner('octicon-repo');
|
|
expect(svgOuter.nodeName).toMatch('svg');
|
|
expect(svgOuter.classList.contains('octicon-repo')).toBeTruthy();
|
|
expect(svgInnerHtml).toContain('<path');
|
|
});
|