-
Notifications
You must be signed in to change notification settings - Fork 47.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
11 changed files
with
116 additions
and
314 deletions.
There are no files selected for viewing
26 changes: 13 additions & 13 deletions
26
compiler/apps/playground/__tests__/e2e/__snapshots__/page.spec.ts/01-user-output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
22 changes: 11 additions & 11 deletions
22
compiler/apps/playground/__tests__/e2e/__snapshots__/page.spec.ts/02-default-output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
24 changes: 4 additions & 20 deletions
24
...snapshots__/page.spec.ts/function-scope-no-directive-arrow-function-expression-output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,4 @@ | ||
function anonymous_1() { | ||
"use no memo"; | ||
const Avatar = () => { | ||
return <div>Avatar Content</div>; | ||
}; | ||
const MemoizedAvatar = React.memo(Avatar); | ||
const Bio = () => { | ||
const handleBioUpdate = () => { | ||
console.log("Bio updated"); | ||
}; | ||
return <div onClick={handleBioUpdate}>Bio Content</div>; | ||
}; | ||
const MemoizedBio = React.memo(Bio); | ||
return ( | ||
<div> | ||
<MemoizedAvatar /> | ||
<MemoizedBio /> | ||
</div> | ||
); | ||
} | ||
function anonymous_1({ x }) { | ||
"use no memo"; | ||
return <Button>{x}</Button>; | ||
} |
46 changes: 14 additions & 32 deletions
46
...e/__snapshots__/page.spec.ts/function-scope-use-memo-arrow-function-expression-output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,14 @@ | ||
function anonymous_1() { | ||
"use memo"; | ||
const $ = _c(3); | ||
const Chart = _temp2; | ||
let t0; | ||
if ($[0] === Symbol.for("react.memo_cache_sentinel")) { | ||
t0 = React.memo(Chart); | ||
$[0] = t0; | ||
} else { | ||
t0 = $[0]; | ||
} | ||
const MemoizedChart = t0; | ||
const Graph = _temp3; | ||
let t1; | ||
if ($[1] === Symbol.for("react.memo_cache_sentinel")) { | ||
t1 = React.memo(Graph); | ||
$[1] = t1; | ||
} else { | ||
t1 = $[1]; | ||
} | ||
const MemoizedGraph = t1; | ||
let t2; | ||
if ($[2] === Symbol.for("react.memo_cache_sentinel")) { | ||
t2 = ( | ||
<div> | ||
<MemoizedChart /> | ||
<MemoizedGraph /> | ||
</div> | ||
); | ||
$[2] = t2; | ||
} else { | ||
t2 = $[2]; | ||
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; | ||
} |
46 changes: 14 additions & 32 deletions
46
...__/e2e/__snapshots__/page.spec.ts/function-scope-use-memo-function-declaration-output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,14 @@ | ||
function App() { | ||
"use memo"; | ||
const $ = _c(3); | ||
let t0; | ||
if ($[0] === Symbol.for("react.memo_cache_sentinel")) { | ||
const Sidebar = function Sidebar() { | ||
const handleToggle = _temp; | ||
return <aside onClick={handleToggle}>Sidebar Content</ | ||
aside>; | ||
}; | ||
t0 = React.memo(Sidebar); | ||
$[0] = t0; | ||
} else { | ||
t0 = $[0]; | ||
} | ||
const MemoizedSidebar = t0; | ||
let t1; | ||
if ($[1] === Symbol.for("react.memo_cache_sentinel")) { | ||
const Content = function Content() { | ||
return <main>Main Content</main>; | ||
}; | ||
t1 = React.memo(Content); | ||
$[1] = t1; | ||
} else { | ||
t1 = $[1]; | ||
} | ||
const MemoizedContent = t1; | ||
let t2; | ||
if ($[2] === Symbol.for("react.memo_cache_sentinel")) { | ||
t2 = ( | ||
<div> | ||
<MemoizedSidebar /> | ||
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; | ||
} |
46 changes: 14 additions & 32 deletions
46
...e2e/__snapshots__/page.spec.ts/function-scope-use-no-memo-function-declaration-output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,14 @@ | ||
function Settings() { | ||
"use memo"; | ||
const $ = _c(3); | ||
let t0; | ||
if ($[0] === Symbol.for("react.memo_cache_sentinel")) { | ||
t0 = function Preferences() { | ||
const handleSave = _temp; | ||
return <div onClick={handleSave}>Preferences Content</ | ||
div>; | ||
}; | ||
$[0] = t0; | ||
} else { | ||
t0 = $[0]; | ||
} | ||
const Preferences = t0; | ||
let t1; | ||
if ($[1] === Symbol.for("react.memo_cache_sentinel")) { | ||
t1 = function Notifications() { | ||
return <div>Notifications Settings</div>; | ||
}; | ||
$[1] = t1; | ||
} else { | ||
t1 = $[1]; | ||
} | ||
const Notifications = t1; | ||
let t2; | ||
if ($[2] === Symbol.for("react.memo_cache_sentinel")) { | ||
t2 = ( | ||
<div> | ||
<Preferences /> | ||
<Notifications /> | ||
</div> | ||
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; | ||
} |
22 changes: 4 additions & 18 deletions
22
.../e2e/__snapshots__/page.spec.ts/function-scope-use-no-memo-function-expression-output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,4 @@ | ||
function anonymous_1() { | ||
"use no memo"; | ||
const Widget = function () { | ||
const handleExpand = () => { | ||
console.log("Widget expanded"); | ||
}; | ||
return <div onClick={handleExpand}>Widget Content</div>; | ||
}; | ||
const Panel = function () { | ||
return <section>Panel Information</section>; | ||
}; | ||
return ( | ||
<div> | ||
<Widget /> | ||
<Panel /> | ||
</div> | ||
); | ||
} | ||
function anonymous_1() { | ||
"use no memo"; | ||
return <Button>{x}</Button>; | ||
} |
26 changes: 12 additions & 14 deletions
26
...apps/playground/__tests__/e2e/__snapshots__/page.spec.ts/module-scope-use-memo-output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} |
6 changes: 3 additions & 3 deletions
6
...__/e2e/__snapshots__/page.spec.ts/module-scope-use-no-memo-function-expression-output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
function anonymous_1() { | ||
return <aside>Sidebar Information</aside>; | ||
} | ||
function anonymous_1({ x }) { | ||
return <Button>{x}</Button>; | ||
} |
10 changes: 3 additions & 7 deletions
10
...s/playground/__tests__/e2e/__snapshots__/page.spec.ts/module-scope-use-no-memo-output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
} |
Oops, something went wrong.