From 03af42fad40605888ae44ae9fbc4455458e10944 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sun, 2 Dec 2018 17:50:55 -0500 Subject: [PATCH] fix all CSS tests --- test/css/index.js | 4 ++-- test/css/samples/nested/_config.js | 2 +- .../_config.js | 2 +- .../_config.js | 2 +- .../_config.js | 2 +- .../_config.js | 2 +- .../_config.js | 2 +- .../_config.js | 2 +- .../omit-scoping-attribute-global/_config.js | 2 +- test/css/samples/refs-qualified/_config.js | 22 +++++++++---------- test/css/samples/refs-qualified/input.html | 5 +++++ .../unused-selector-ternary/_config.js | 2 +- 12 files changed, 27 insertions(+), 22 deletions(-) diff --git a/test/css/index.js b/test/css/index.js index ba297442ce..3749a11f0b 100644 --- a/test/css/index.js +++ b/test/css/index.js @@ -110,7 +110,7 @@ describe.only('css', () => { try { const target = window.document.querySelector('main'); - new ClientComponent({ target, data: config.data }); + new ClientComponent({ target, props: config.props }); const html = target.innerHTML; fs.writeFileSync(`test/css/samples/${dir}/_actual.html`, html); @@ -131,7 +131,7 @@ describe.only('css', () => { assert.equal( normalizeHtml( window, - ServerComponent.render(config.data).html.replace(/svelte(-ref)?-[a-z0-9]+/g, (m, $1) => $1 ? m : 'svelte-xyz') + ServerComponent.render(config.props).html.replace(/svelte(-ref)?-[a-z0-9]+/g, (m, $1) => $1 ? m : 'svelte-xyz') ), normalizeHtml(window, expected.html) ); diff --git a/test/css/samples/nested/_config.js b/test/css/samples/nested/_config.js index 7cf5c058a6..e90f873ac1 100644 --- a/test/css/samples/nested/_config.js +++ b/test/css/samples/nested/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { dynamic: 'x' } }; \ No newline at end of file diff --git a/test/css/samples/omit-scoping-attribute-attribute-selector-equals-dynamic/_config.js b/test/css/samples/omit-scoping-attribute-attribute-selector-equals-dynamic/_config.js index 83f70a7c02..2e954ca8e9 100644 --- a/test/css/samples/omit-scoping-attribute-attribute-selector-equals-dynamic/_config.js +++ b/test/css/samples/omit-scoping-attribute-attribute-selector-equals-dynamic/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { dynamic: 'whatever' } }; \ No newline at end of file diff --git a/test/css/samples/omit-scoping-attribute-descendant-global-inner-class/_config.js b/test/css/samples/omit-scoping-attribute-descendant-global-inner-class/_config.js index 4b4ce74d72..1ae834ca0d 100644 --- a/test/css/samples/omit-scoping-attribute-descendant-global-inner-class/_config.js +++ b/test/css/samples/omit-scoping-attribute-descendant-global-inner-class/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { raw: '

raw

' } }; \ No newline at end of file diff --git a/test/css/samples/omit-scoping-attribute-descendant-global-inner-multiple/_config.js b/test/css/samples/omit-scoping-attribute-descendant-global-inner-multiple/_config.js index 4b4ce74d72..1ae834ca0d 100644 --- a/test/css/samples/omit-scoping-attribute-descendant-global-inner-multiple/_config.js +++ b/test/css/samples/omit-scoping-attribute-descendant-global-inner-multiple/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { raw: '

raw

' } }; \ No newline at end of file diff --git a/test/css/samples/omit-scoping-attribute-descendant-global-inner/_config.js b/test/css/samples/omit-scoping-attribute-descendant-global-inner/_config.js index 4b4ce74d72..1ae834ca0d 100644 --- a/test/css/samples/omit-scoping-attribute-descendant-global-inner/_config.js +++ b/test/css/samples/omit-scoping-attribute-descendant-global-inner/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { raw: '

raw

' } }; \ No newline at end of file diff --git a/test/css/samples/omit-scoping-attribute-descendant-global-outer-multiple/_config.js b/test/css/samples/omit-scoping-attribute-descendant-global-outer-multiple/_config.js index 4b4ce74d72..1ae834ca0d 100644 --- a/test/css/samples/omit-scoping-attribute-descendant-global-outer-multiple/_config.js +++ b/test/css/samples/omit-scoping-attribute-descendant-global-outer-multiple/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { raw: '

raw

' } }; \ No newline at end of file diff --git a/test/css/samples/omit-scoping-attribute-descendant-global-outer/_config.js b/test/css/samples/omit-scoping-attribute-descendant-global-outer/_config.js index 4b4ce74d72..1ae834ca0d 100644 --- a/test/css/samples/omit-scoping-attribute-descendant-global-outer/_config.js +++ b/test/css/samples/omit-scoping-attribute-descendant-global-outer/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { raw: '

raw

' } }; \ No newline at end of file diff --git a/test/css/samples/omit-scoping-attribute-global/_config.js b/test/css/samples/omit-scoping-attribute-global/_config.js index 4b4ce74d72..1ae834ca0d 100644 --- a/test/css/samples/omit-scoping-attribute-global/_config.js +++ b/test/css/samples/omit-scoping-attribute-global/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { raw: '

raw

' } }; \ No newline at end of file diff --git a/test/css/samples/refs-qualified/_config.js b/test/css/samples/refs-qualified/_config.js index dbc3ac2b4e..bc90dafaec 100644 --- a/test/css/samples/refs-qualified/_config.js +++ b/test/css/samples/refs-qualified/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { active: true }, @@ -8,21 +8,21 @@ export default { message: 'Unused CSS selector', start: { column: 1, - line: 12, - character: 169 + line: 17, + character: 222 }, end: { column: 20, - line: 12, - character: 188 + line: 17, + character: 241 }, - pos: 169, + pos: 222, frame: ` - 10: } - 11: - 12: ref:button.inactive { + 15: } + 16: + 17: ref:button.inactive { ^ - 13: color: green; - 14: }` + 18: color: green; + 19: }` }] }; \ No newline at end of file diff --git a/test/css/samples/refs-qualified/input.html b/test/css/samples/refs-qualified/input.html index f23a4f1845..08e31b748a 100644 --- a/test/css/samples/refs-qualified/input.html +++ b/test/css/samples/refs-qualified/input.html @@ -1,3 +1,8 @@ + + {#if active} {:else} diff --git a/test/css/samples/unused-selector-ternary/_config.js b/test/css/samples/unused-selector-ternary/_config.js index f99ad90601..043a7addf9 100644 --- a/test/css/samples/unused-selector-ternary/_config.js +++ b/test/css/samples/unused-selector-ternary/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { active: true },