Skip to content

Commit

Permalink
[playground] Fix broken tests
Browse files Browse the repository at this point in the history
Our e2e setup with monaco is kinda brittle since it relies on the dom. It seems like longish text gets truncated so let's just simpify all these test cases.
  • Loading branch information
poteto committed Nov 18, 2024
1 parent 0dac86f commit de535b1
Show file tree
Hide file tree
Showing 15 changed files with 143 additions and 343 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
function TestComponent(t0) {
  const $ = _c(2);
  const { x } = t0;
  let t1;
  if ($[0] !== x) {
    t1 = <Button>{x}</Button>;
    $[0] = x;
    $[1] = t1;
  } else {
    t1 = $[1];
  }
  return t1;
}
function TestComponent(t0) {
const $ = _c(2);
const { x } = t0;
let t1;
if ($[0] !== x) {
t1 = <Button>{x}</Button>;
$[0] = x;
$[1] = t1;
} else {
t1 = $[1];
}
return t1;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
function MyApp() {
  const $ = _c(1);
  let t0;
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
    t0 = <div>Hello World</div>;
    $[0] = t0;
  } else {
    t0 = $[0];
  }
  return t0;
}
function MyApp() {
const $ = _c(1);
let t0;
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
t0 = <div>Hello World</div>;
$[0] = t0;
} else {
t0 = $[0];
}
return t0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function TestComponent(t0) {
"use memo";
const $ = _c(2);
const { x } = t0;
let t1;
if ($[0] !== x) {
t1 = <Button>{x}</Button>;
$[0] = x;
$[1] = t1;
} else {
t1 = $[1];
}
return t1;
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
function anonymous_1() {
  const $ = _c(1);
  const handleClick = _temp;
  let t0;
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
    t0 = <h1 onClick={handleClick}>Welcome to the App!</h1>;
    $[0] = t0;
  } else {
    t0 = $[0];
  }
  return t0;
function TestComponent(t0) {
const $ = _c(2);
const { x } = t0;
let t1;
if ($[0] !== x) {
t1 = <Button>{x}</Button>;
$[0] = x;
$[1] = t1;
} else {
t1 = $[1];
}
return t1;
}
function _temp() {
  console.log("Header clicked");
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
function anonymous_1() {
  const handleMouseOver = () => {
    console.log("Footer hovered");
  };
  return <footer onMouseOver={handleMouseOver}>Footer 
      Information</footer>;
}
function TestComponent({ x }) {
return <Button>{x}</Button>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
function TestComponent(t0) {
"use memo";
const $ = _c(2);
const { x } = t0;
let t1;
if ($[0] !== x) {
t1 = <Button>{x}</Button>;
$[0] = x;
$[1] = t1;
} else {
t1 = $[1];
}
return t1;
}
function anonymous_1(t0) {
"use memo";
const $ = _c(2);
const { x } = t0;
let t1;
if ($[0] !== x) {
t1 = <Button>{x}</Button>;
$[0] = x;
$[1] = t1;
} else {
t1 = $[1];
}
return t1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function anonymous_1() {
"use no memo";
return <Button>{x}</Button>;
}
function anonymous_3({ x }) {
"use no memo";
return <Button>{x}</Button>;
}
Loading

0 comments on commit de535b1

Please sign in to comment.