Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: reduce output by using getTestWrapper #487

Merged
merged 1 commit into from Apr 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 27 additions & 0 deletions test/parse/__snapshots__/parse-element.test.js.snap
Expand Up @@ -9,6 +9,24 @@ Object {
}
`;

exports[`XML Node Parse closing tag with unquoted value following / 1`] = `
Object {
"warning": Array [
"[xmldom warning] attribute \\"lazy\\" missed quot(\\")!
@#[line:3,col:3]",
],
}
`;

exports[`XML Node Parse closing tag with unquoted value following space and / 1`] = `
Object {
"warning": Array [
"[xmldom warning] attribute \\"lazy\\" missed quot(\\")!!
@#[line:3,col:3]",
],
}
`;

exports[`XML Node Parse closing tag with unquoted value including / followed by space / 1`] = `
Object {
"warning": Array [
Expand All @@ -18,6 +36,15 @@ Object {
}
`;

exports[`XML Node Parse closing tag without attribute value 1`] = `
Object {
"warning": Array [
"[xmldom warning] attribute \\"lazy\\" missed value!! \\"lazy\\" instead!!
@#[line:3,col:3]",
],
}
`;

exports[`XML Node Parse namespaced attributes unclosed root tag will be closed 1`] = `
Object {
"actual": "<xml xmlns=\\"1\\" xmlns:a=\\"2\\" a:test=\\"3/\\"/>",
Expand Down
12 changes: 9 additions & 3 deletions test/parse/parse-element.test.js
Expand Up @@ -40,7 +40,8 @@ describe('XML Node Parse', () => {
});

it('closing tag without attribute value', () => {
const actual = new DOMParser()
const { errors, parser } = getTestParser();
const actual = parser
.parseFromString(
`<template>
<view>
Expand All @@ -51,6 +52,7 @@ describe('XML Node Parse', () => {
'text/xml'
)
.toString();
expect(errors).toMatchSnapshot();
expect(actual).toBe(
`<template>
<view>
Expand All @@ -61,7 +63,8 @@ describe('XML Node Parse', () => {
);
});
it('closing tag with unquoted value following /', () => {
const actual = new DOMParser()
const { errors, parser } = getTestParser();
const actual = parser
.parseFromString(
`<template>
<view>
Expand All @@ -72,6 +75,7 @@ describe('XML Node Parse', () => {
'text/xml'
)
.toString();
expect(errors).toMatchSnapshot();
expect(actual).toBe(
`<template>
<view>
Expand All @@ -82,7 +86,8 @@ describe('XML Node Parse', () => {
);
});
it('closing tag with unquoted value following space and /', () => {
const actual = new DOMParser()
const { errors, parser } = getTestParser();
const actual = parser
.parseFromString(
`<template>
<view>
Expand All @@ -93,6 +98,7 @@ describe('XML Node Parse', () => {
'text/xml'
)
.toString();
expect(errors).toMatchSnapshot();
expect(actual).toBe(
`<template>
<view>
Expand Down