Skip to content

Commit

Permalink
fix: restore tests (#2484)
Browse files Browse the repository at this point in the history
  • Loading branch information
rturnq authored Jan 31, 2025
1 parent 0135f5b commit 0ee5875
Show file tree
Hide file tree
Showing 15 changed files with 853 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,17 @@ container.querySelector("button").click();
c
</p>
```


# Render
```js
container.querySelector("button").click();
```
```html
<button>
Toggle
</button>
<div>
destroyed
</div>
```
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,28 @@ INSERT p
REMOVE #text after div0
REMOVE #text in div0
INSERT div0/#text
```

# Render
```js
container.querySelector("button").click();
```
```html
<button>
Toggle
</button>
<div>
destroyed
</div>
<!---->
```

# Mutations
```
INSERT #text
REMOVE #text in div
INSERT div/#text
REMOVE div after div
REMOVE span after div
REMOVE p after div
```
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,17 @@ container.querySelector("button").click();
c
</p>
```


# Render
```js
container.querySelector("button").click();
```
```html
<button>
Toggle
</button>
<div>
destroyed
</div>
```
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,39 @@ INSERT html/body/p
REMOVE #comment after html/body/#comment1
REMOVE #text in html/body/div0
INSERT html/body/div0/#text
```

# Render
```js
container.querySelector("button").click();
```
```html
<html>
<head />
<body>
<button>
Toggle
</button>
<!--M_*1 #button/0-->
<div>
destroyed
</div>
<!--M_*1 #div/1-->
<!--M_]1 #text/2-->
<!--M_$3-->
<script>
WALKER_RUNTIME("M")("_");M._.r=[_=&gt;(_.e={1:_.a={show:!0,"#text/2(":_._["__tests__/template.marko_1_renderer"],"#text/2!":_.b={"#childScope/0":_.d={input:_.c={}}}},2:_.b,3:_.d},_.b._=_.a,_.c.write=_._["__tests__/template.marko_1/write"](_.b),_.e),3,"__tests__/tags/child.marko_0_input",1,"__tests__/template.marko_0_show",0];M._.w()
</script>
</body>
</html>
```

# Mutations
```
INSERT html/body/#comment2
REMOVE #text in html/body/div
INSERT html/body/div/#text
REMOVE div after html/body/#comment1
REMOVE span after html/body/#comment1
REMOVE p after html/body/#comment1
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const steps = [{}, click, click];
export const steps = [{}, click, click, click];

function click(container: Element) {
container.querySelector("button")!.click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@
>
firstsecondthird
</div>
<div
class="by-function"
>
firstsecondthird
</div>
<div
class="by-unknown-string"
>
firstsecondthird
</div>
<div
class="by-unknown-function"
>
firstsecondthird
</div>
<div
class="by-unknown-missing"
>
firstsecondthird
</div>
<button>
Rotate
</button>
Expand All @@ -24,6 +44,26 @@ container.querySelector("button").click();
>
secondthirdfirst
</div>
<div
class="by-function"
>
secondthirdfirst
</div>
<div
class="by-unknown-string"
>
secondthirdfirst
</div>
<div
class="by-unknown-function"
>
secondthirdfirst
</div>
<div
class="by-unknown-missing"
>
secondthirdfirst
</div>
<button>
Rotate
</button>
Expand All @@ -42,6 +82,26 @@ container.querySelector("button").click();
>
thirdfirstsecond
</div>
<div
class="by-function"
>
thirdfirstsecond
</div>
<div
class="by-unknown-string"
>
thirdfirstsecond
</div>
<div
class="by-unknown-function"
>
thirdfirstsecond
</div>
<div
class="by-unknown-missing"
>
thirdfirstsecond
</div>
<button>
Rotate
</button>
Expand All @@ -60,6 +120,26 @@ container.querySelector("button").click();
>
firstsecondthird
</div>
<div
class="by-function"
>
firstsecondthird
</div>
<div
class="by-unknown-string"
>
firstsecondthird
</div>
<div
class="by-unknown-function"
>
firstsecondthird
</div>
<div
class="by-unknown-missing"
>
firstsecondthird
</div>
<button>
Rotate
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@
>
firstsecondthird
</div>
<div
class="by-function"
>
firstsecondthird
</div>
<div
class="by-unknown-string"
>
firstsecondthird
</div>
<div
class="by-unknown-function"
>
firstsecondthird
</div>
<div
class="by-unknown-missing"
>
firstsecondthird
</div>
<button>
Rotate
</button>
Expand All @@ -28,6 +48,26 @@ container.querySelector("button").click();
>
secondthirdfirst
</div>
<div
class="by-function"
>
secondthirdfirst
</div>
<div
class="by-unknown-string"
>
secondthirdfirst
</div>
<div
class="by-unknown-function"
>
secondthirdfirst
</div>
<div
class="by-unknown-missing"
>
secondthirdfirst
</div>
<button>
Rotate
</button>
Expand All @@ -36,8 +76,17 @@ container.querySelector("button").click();

# Mutations
```
REMOVE div/div/#text2 before div/div/#text0
INSERT div/div/#text2
REMOVE div/div0/#text2 before div/div0/#text0
INSERT div/div0/#text2
REMOVE div/div1/#text2 before div/div1/#text0
INSERT div/div1/#text2
REMOVE div/div2/#text2 before div/div2/#text0
INSERT div/div2/#text2
REMOVE div/div3/#text2 before div/div3/#text0
INSERT div/div3/#text2
UPDATE div/div4/#text0 "first" => "second"
UPDATE div/div4/#text1 "second" => "third"
UPDATE div/div4/#text2 "third" => "first"
```

# Render
Expand All @@ -51,6 +100,26 @@ container.querySelector("button").click();
>
thirdfirstsecond
</div>
<div
class="by-function"
>
thirdfirstsecond
</div>
<div
class="by-unknown-string"
>
thirdfirstsecond
</div>
<div
class="by-unknown-function"
>
thirdfirstsecond
</div>
<div
class="by-unknown-missing"
>
thirdfirstsecond
</div>
<button>
Rotate
</button>
Expand All @@ -59,8 +128,17 @@ container.querySelector("button").click();

# Mutations
```
REMOVE div/div/#text2 before div/div/#text0
INSERT div/div/#text2
REMOVE div/div0/#text2 before div/div0/#text0
INSERT div/div0/#text2
REMOVE div/div1/#text2 before div/div1/#text0
INSERT div/div1/#text2
REMOVE div/div2/#text2 before div/div2/#text0
INSERT div/div2/#text2
REMOVE div/div3/#text2 before div/div3/#text0
INSERT div/div3/#text2
UPDATE div/div4/#text0 "second" => "third"
UPDATE div/div4/#text1 "third" => "first"
UPDATE div/div4/#text2 "first" => "second"
```

# Render
Expand All @@ -74,6 +152,26 @@ container.querySelector("button").click();
>
firstsecondthird
</div>
<div
class="by-function"
>
firstsecondthird
</div>
<div
class="by-unknown-string"
>
firstsecondthird
</div>
<div
class="by-unknown-function"
>
firstsecondthird
</div>
<div
class="by-unknown-missing"
>
firstsecondthird
</div>
<button>
Rotate
</button>
Expand All @@ -82,6 +180,15 @@ container.querySelector("button").click();

# Mutations
```
REMOVE div/div/#text2 before div/div/#text0
INSERT div/div/#text2
REMOVE div/div0/#text2 before div/div0/#text0
INSERT div/div0/#text2
REMOVE div/div1/#text2 before div/div1/#text0
INSERT div/div1/#text2
REMOVE div/div2/#text2 before div/div2/#text0
INSERT div/div2/#text2
REMOVE div/div3/#text2 before div/div3/#text0
INSERT div/div3/#text2
UPDATE div/div4/#text0 "third" => "first"
UPDATE div/div4/#text1 "first" => "second"
UPDATE div/div4/#text2 "second" => "third"
```
Loading

0 comments on commit 0ee5875

Please sign in to comment.