From a197c185236aed678ac02c125359fa172dcbe1db Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 29 Aug 2017 21:35:02 -0400 Subject: [PATCH] failing tests for #637 --- .../runtime/samples/raw-anchor-first-child/_config.js | 10 ++++++++++ test/runtime/samples/raw-anchor-first-child/main.html | 1 + .../samples/raw-anchor-first-last-child/_config.js | 11 +++++++++++ .../samples/raw-anchor-first-last-child/main.html | 1 + test/runtime/samples/raw-anchor-last-child/_config.js | 10 ++++++++++ test/runtime/samples/raw-anchor-last-child/main.html | 1 + .../raw-anchor-next-previous-sibling/_config.js | 11 +++++++++++ .../raw-anchor-next-previous-sibling/main.html | 1 + .../samples/raw-anchor-next-sibling/_config.js | 10 ++++++++++ .../runtime/samples/raw-anchor-next-sibling/main.html | 1 + .../samples/raw-anchor-previous-sibling/_config.js | 10 ++++++++++ .../samples/raw-anchor-previous-sibling/main.html | 1 + 12 files changed, 68 insertions(+) create mode 100644 test/runtime/samples/raw-anchor-first-child/_config.js create mode 100644 test/runtime/samples/raw-anchor-first-child/main.html create mode 100644 test/runtime/samples/raw-anchor-first-last-child/_config.js create mode 100644 test/runtime/samples/raw-anchor-first-last-child/main.html create mode 100644 test/runtime/samples/raw-anchor-last-child/_config.js create mode 100644 test/runtime/samples/raw-anchor-last-child/main.html create mode 100644 test/runtime/samples/raw-anchor-next-previous-sibling/_config.js create mode 100644 test/runtime/samples/raw-anchor-next-previous-sibling/main.html create mode 100644 test/runtime/samples/raw-anchor-next-sibling/_config.js create mode 100644 test/runtime/samples/raw-anchor-next-sibling/main.html create mode 100644 test/runtime/samples/raw-anchor-previous-sibling/_config.js create mode 100644 test/runtime/samples/raw-anchor-previous-sibling/main.html diff --git a/test/runtime/samples/raw-anchor-first-child/_config.js b/test/runtime/samples/raw-anchor-first-child/_config.js new file mode 100644 index 0000000000..c6fe8430f3 --- /dev/null +++ b/test/runtime/samples/raw-anchor-first-child/_config.js @@ -0,0 +1,10 @@ +export default { + data: { + raw: `foo` + }, + + test ( assert, component, target ) { + const span = target.querySelector('span'); + assert.equal(!span.previousSibling); + } +}; diff --git a/test/runtime/samples/raw-anchor-first-child/main.html b/test/runtime/samples/raw-anchor-first-child/main.html new file mode 100644 index 0000000000..f9a62f27ea --- /dev/null +++ b/test/runtime/samples/raw-anchor-first-child/main.html @@ -0,0 +1 @@ +
{{{raw}}}{{#if maybe}}after{{/if}}
diff --git a/test/runtime/samples/raw-anchor-first-last-child/_config.js b/test/runtime/samples/raw-anchor-first-last-child/_config.js new file mode 100644 index 0000000000..60cbd02d39 --- /dev/null +++ b/test/runtime/samples/raw-anchor-first-last-child/_config.js @@ -0,0 +1,11 @@ +export default { + data: { + raw: `foo` + }, + + test ( assert, component, target ) { + const span = target.querySelector('span'); + assert.equal(!span.previousSibling); + assert.equal(!span.nextSibling); + } +}; diff --git a/test/runtime/samples/raw-anchor-first-last-child/main.html b/test/runtime/samples/raw-anchor-first-last-child/main.html new file mode 100644 index 0000000000..4f10ae03c0 --- /dev/null +++ b/test/runtime/samples/raw-anchor-first-last-child/main.html @@ -0,0 +1 @@ +
{{{raw}}}
diff --git a/test/runtime/samples/raw-anchor-last-child/_config.js b/test/runtime/samples/raw-anchor-last-child/_config.js new file mode 100644 index 0000000000..5ec1dd87de --- /dev/null +++ b/test/runtime/samples/raw-anchor-last-child/_config.js @@ -0,0 +1,10 @@ +export default { + data: { + raw: `foo` + }, + + test ( assert, component, target ) { + const span = target.querySelector('span'); + assert.equal(!span.nextSibling); + } +}; diff --git a/test/runtime/samples/raw-anchor-last-child/main.html b/test/runtime/samples/raw-anchor-last-child/main.html new file mode 100644 index 0000000000..67b6adf483 --- /dev/null +++ b/test/runtime/samples/raw-anchor-last-child/main.html @@ -0,0 +1 @@ +
{{#if maybe}}after{{/if}}{{{raw}}}
diff --git a/test/runtime/samples/raw-anchor-next-previous-sibling/_config.js b/test/runtime/samples/raw-anchor-next-previous-sibling/_config.js new file mode 100644 index 0000000000..5d2f0bed84 --- /dev/null +++ b/test/runtime/samples/raw-anchor-next-previous-sibling/_config.js @@ -0,0 +1,11 @@ +export default { + data: { + raw: `foo` + }, + + test ( assert, component, target ) { + const span = target.querySelector('span'); + assert.equal(span.previousSibling.nodeName, 'BR'); + assert.equal(span.nextSibling.nodeName, 'BR'); + } +}; diff --git a/test/runtime/samples/raw-anchor-next-previous-sibling/main.html b/test/runtime/samples/raw-anchor-next-previous-sibling/main.html new file mode 100644 index 0000000000..d0a2a83668 --- /dev/null +++ b/test/runtime/samples/raw-anchor-next-previous-sibling/main.html @@ -0,0 +1 @@ +before
{{{raw}}}
after diff --git a/test/runtime/samples/raw-anchor-next-sibling/_config.js b/test/runtime/samples/raw-anchor-next-sibling/_config.js new file mode 100644 index 0000000000..591bc03af8 --- /dev/null +++ b/test/runtime/samples/raw-anchor-next-sibling/_config.js @@ -0,0 +1,10 @@ +export default { + data: { + raw: `foo` + }, + + test ( assert, component, target ) { + const span = target.querySelector('span'); + assert.equal(span.previousSibling.nodeName, 'BR'); + } +}; diff --git a/test/runtime/samples/raw-anchor-next-sibling/main.html b/test/runtime/samples/raw-anchor-next-sibling/main.html new file mode 100644 index 0000000000..00c18218a0 --- /dev/null +++ b/test/runtime/samples/raw-anchor-next-sibling/main.html @@ -0,0 +1 @@ +before
{{{raw}}}{{#if maybe}}after{{/if}} diff --git a/test/runtime/samples/raw-anchor-previous-sibling/_config.js b/test/runtime/samples/raw-anchor-previous-sibling/_config.js new file mode 100644 index 0000000000..591bc03af8 --- /dev/null +++ b/test/runtime/samples/raw-anchor-previous-sibling/_config.js @@ -0,0 +1,10 @@ +export default { + data: { + raw: `foo` + }, + + test ( assert, component, target ) { + const span = target.querySelector('span'); + assert.equal(span.previousSibling.nodeName, 'BR'); + } +}; diff --git a/test/runtime/samples/raw-anchor-previous-sibling/main.html b/test/runtime/samples/raw-anchor-previous-sibling/main.html new file mode 100644 index 0000000000..00c18218a0 --- /dev/null +++ b/test/runtime/samples/raw-anchor-previous-sibling/main.html @@ -0,0 +1 @@ +before
{{{raw}}}{{#if maybe}}after{{/if}}