diff --git a/test/parser/samples/attribute-class-directive.solo/input.svelte b/test/parser/samples/attribute-class-directive.solo/input.svelte new file mode 100644 index 0000000000..629df2e29f --- /dev/null +++ b/test/parser/samples/attribute-class-directive.solo/input.svelte @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/test/parser/samples/attribute-class-directive.solo/output.json b/test/parser/samples/attribute-class-directive.solo/output.json new file mode 100644 index 0000000000..abb2e0c0be --- /dev/null +++ b/test/parser/samples/attribute-class-directive.solo/output.json @@ -0,0 +1,41 @@ +{ + "html": { + "start": 0, + "end": 29, + "type": "Fragment", + "children": [ + { + "start": 0, + "end": 29, + "type": "Element", + "name": "div", + "attributes": [ + { + "start": 5, + "end": 22, + "type": "Class", + "name": "foo", + "modifiers": [], + "expression": { + "type": "Identifier", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "isFoo" + } + } + ], + "children": [] + } + ] + } +} \ No newline at end of file diff --git a/test/parser/samples/attribute-style.solo/input.svelte b/test/parser/samples/attribute-style.solo/input.svelte new file mode 100644 index 0000000000..12872605ad --- /dev/null +++ b/test/parser/samples/attribute-style.solo/input.svelte @@ -0,0 +1 @@ +
red
\ No newline at end of file diff --git a/test/parser/samples/attribute-style.solo/output.json b/test/parser/samples/attribute-style.solo/output.json new file mode 100644 index 0000000000..95c0c8a7a4 --- /dev/null +++ b/test/parser/samples/attribute-style.solo/output.json @@ -0,0 +1,41 @@ +{ + "html": { + "start": 0, + "end": 34, + "type": "Fragment", + "children": [ + { + "start": 0, + "end": 34, + "type": "Element", + "name": "div", + "attributes": [ + { + "start": 5, + "end": 24, + "type": "Attribute", + "name": "style", + "value": [ + { + "start": 12, + "end": 23, + "type": "Text", + "raw": "color: red;", + "data": "color: red;" + } + ] + } + ], + "children": [ + { + "start": 25, + "end": 28, + "type": "Text", + "raw": "red", + "data": "red" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/test/runtime/samples/inline-style-directive-and-style-attr/main.svelte b/test/runtime/samples/inline-style-directive-and-style-attr/main.svelte new file mode 100644 index 0000000000..fdcdc9e66e --- /dev/null +++ b/test/runtime/samples/inline-style-directive-and-style-attr/main.svelte @@ -0,0 +1,5 @@ + + +

{color}

diff --git a/test/runtime/samples/inline-style-directive.solo/main.svelte b/test/runtime/samples/inline-style-directive.solo/main.svelte index 2360d64351..1d60aefa6f 100644 --- a/test/runtime/samples/inline-style-directive.solo/main.svelte +++ b/test/runtime/samples/inline-style-directive.solo/main.svelte @@ -1,5 +1,5 @@ -

\ No newline at end of file +

diff --git a/test/runtime/samples/inline-style.solo/_config.js b/test/runtime/samples/inline-style.solo/_config.js new file mode 100644 index 0000000000..3e984d4c69 --- /dev/null +++ b/test/runtime/samples/inline-style.solo/_config.js @@ -0,0 +1,12 @@ +export default { + html: ` +

+ `, + + test({ assert, component, target, window }) { + const p = target.querySelector('div'); + + const styles = window.getComputedStyle(p); + assert.equal(styles.color, 'red'); + } +}; diff --git a/test/runtime/samples/inline-style.solo/main.svelte b/test/runtime/samples/inline-style.solo/main.svelte new file mode 100644 index 0000000000..0f37a04c99 --- /dev/null +++ b/test/runtime/samples/inline-style.solo/main.svelte @@ -0,0 +1 @@ +
\ No newline at end of file