fix tests using new add_css methods

pull/5639/head
Ivan Hofer 5 years ago
parent 9a4cf3c3f8
commit 83d5fe8256

@ -1,7 +1,9 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
addCssToComponent,
append, append,
appendStyleIfNotPresent,
attr, attr,
detach, detach,
element, element,
@ -13,11 +15,8 @@ import {
text text
} from "svelte/internal"; } from "svelte/internal";
function add_css() { function add_css(customStyleTag) {
var style = element("style"); appendStyleIfNotPresent(customStyleTag || document.head, "svelte-1a7i8ec-style", "p.svelte-1a7i8ec{color:red}");
style.id = "svelte-1a7i8ec-style";
style.textContent = "p.svelte-1a7i8ec{color:red}";
append(document.head, style);
} }
function create_fragment(ctx) { function create_fragment(ctx) {
@ -58,7 +57,7 @@ function instance($$self, $$props, $$invalidate) {
class Component extends SvelteComponent { class Component extends SvelteComponent {
constructor(options) { constructor(options) {
super(); super();
if (!document.getElementById("svelte-1a7i8ec-style")) add_css(); addCssToComponent(this, add_css, options);
init(this, options, instance, create_fragment, safe_not_equal, { foo: 0 }); init(this, options, instance, create_fragment, safe_not_equal, { foo: 0 });
} }
} }

@ -1,7 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
append, addCssToComponent,
appendStyleIfNotPresent,
attr, attr,
detach, detach,
element, element,
@ -11,11 +12,8 @@ import {
safe_not_equal safe_not_equal
} from "svelte/internal"; } from "svelte/internal";
function add_css() { function add_css(customStyleTag) {
var style = element("style"); appendStyleIfNotPresent(customStyleTag || document.head, "svelte-1slhpfn-style", "@media(min-width: 1px){div.svelte-1slhpfn{color:red}}");
style.id = "svelte-1slhpfn-style";
style.textContent = "@media(min-width: 1px){div.svelte-1slhpfn{color:red}}";
append(document.head, style);
} }
function create_fragment(ctx) { function create_fragment(ctx) {
@ -41,7 +39,7 @@ function create_fragment(ctx) {
class Component extends SvelteComponent { class Component extends SvelteComponent {
constructor(options) { constructor(options) {
super(); super();
if (!document.getElementById("svelte-1slhpfn-style")) add_css(); addCssToComponent(this, add_css, options);
init(this, options, null, create_fragment, safe_not_equal, {}); init(this, options, null, create_fragment, safe_not_equal, {});
} }
} }

Loading…
Cancel
Save