Skip to content

Commit

Permalink
Update svgRegistryTests.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
tsv2013 authored Nov 22, 2024
1 parent f0ea7b6 commit 67f05a8
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions packages/survey-core/tests/icons/svgRegistryTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,22 @@ QUnit.test("svg import from svg via string - use prefix", function (assert) {
assert.equal(svg.iconsRenderedHtml(), "<symbol id=\"icon-a\" viewBox=\"0 0 100 100\"><circle/></symbol>");
});

// QUnit.test("check that user's svgs with old name will be supported after icons renaming", function (assert) {
// const oldIconName = "icon-changecamera"; // see renamedIcons dictionary
// const newIconName = "icon-flip-24x24";

// let svg = new SvgIconRegistry();
// let res = svg.registerIconFromSvg(oldIconName, "<svg viewBox=\"0 0 100 100\"><circle/></svg>");
// assert.ok(res);
// assert.equal(svg.iconsRenderedHtml(), `<symbol id="${newIconName}" viewBox="0 0 100 100"><circle/></symbol>`);
// });

// QUnit.test("check that user's svgs with old name will be supported after icons renaming: whithout 'icon-' prefix", function (assert) {
// const oldIconName = "changecamera"; // see renamedIcons dictionary
// const newIconName = "flip-24x24";

// let svg = new SvgIconRegistry();
// let res = svg.registerIconFromSvg(oldIconName, "<svg viewBox=\"0 0 100 100\"><circle/></svg>");
// assert.ok(res);
// assert.equal(svg.iconsRenderedHtml(), `<symbol id="icon-${newIconName}" viewBox="0 0 100 100"><circle/></symbol>`);
// });
QUnit.test("check that user's svgs with old name will be supported after icons renaming", function (assert) {
const oldIconName = "icon-changecamera"; // see renamedIcons dictionary
const newIconName = "icon-flip-24x24";

let svg = new SvgIconRegistry();
let res = svg.registerIconFromSvg(oldIconName, "<svg viewBox=\"0 0 100 100\"><circle/></svg>");
assert.ok(res);
assert.equal(svg.iconsRenderedHtml(), `<symbol id="${newIconName}" viewBox="0 0 100 100"><circle/></symbol>`);
});

QUnit.test("check that user's svgs with old name will be supported after icons renaming: whithout 'icon-' prefix", function (assert) {
const oldIconName = "changecamera"; // see renamedIcons dictionary
const newIconName = "flip-24x24";

let svg = new SvgIconRegistry();
let res = svg.registerIconFromSvg(oldIconName, "<svg viewBox=\"0 0 100 100\"><circle/></svg>");
assert.ok(res);
assert.equal(svg.iconsRenderedHtml(), `<symbol id="icon-${newIconName}" viewBox="0 0 100 100"><circle/></symbol>`);
});

0 comments on commit 67f05a8

Please sign in to comment.