summaryrefslogtreecommitdiff
path: root/packages/astro
diff options
context:
space:
mode:
Diffstat (limited to 'packages/astro')
-rw-r--r--packages/astro/test/fixtures/react-component/src/components/Pure.jsx13
-rw-r--r--packages/astro/test/fixtures/react-component/src/pages/index.astro2
-rw-r--r--packages/astro/test/react-component.test.js1
3 files changed, 16 insertions, 0 deletions
diff --git a/packages/astro/test/fixtures/react-component/src/components/Pure.jsx b/packages/astro/test/fixtures/react-component/src/components/Pure.jsx
new file mode 100644
index 000000000..6fae8613b
--- /dev/null
+++ b/packages/astro/test/fixtures/react-component/src/components/Pure.jsx
@@ -0,0 +1,13 @@
+import React from 'react';
+
+export default class StaticComponent extends React.PureComponent {
+
+ render() {
+ return (
+ <div id="pure">
+ <h1>Static component</h1>
+ </div>
+ )
+ }
+
+} \ No newline at end of file
diff --git a/packages/astro/test/fixtures/react-component/src/pages/index.astro b/packages/astro/test/fixtures/react-component/src/pages/index.astro
index 3c0240296..5ebbd6e60 100644
--- a/packages/astro/test/fixtures/react-component/src/pages/index.astro
+++ b/packages/astro/test/fixtures/react-component/src/pages/index.astro
@@ -4,6 +4,7 @@ import Later from '../components/Goodbye.vue'; // use different specifier
import ArrowFunction from '../components/ArrowFunction.jsx';
import PropsSpread from '../components/PropsSpread.jsx';
import {Research2} from '../components/Research.jsx';
+import Pure from '../components/Pure.jsx';
import TypeScriptComponent from '../components/TypeScriptComponent';
const someProps = {
@@ -22,5 +23,6 @@ const someProps = {
<PropsSpread {...someProps}/>
<Research2 client:idle />
<TypeScriptComponent client:load />
+ <Pure />
</body>
</html>
diff --git a/packages/astro/test/react-component.test.js b/packages/astro/test/react-component.test.js
index 6bfde0d25..390573bbb 100644
--- a/packages/astro/test/react-component.test.js
+++ b/packages/astro/test/react-component.test.js
@@ -44,6 +44,7 @@ React('Can load React', async () => {
assert.equal($('#component-spread-props').length, 1, 'Can use spread for components');
assert.equal($('#component-spread-props').text(), 'Hello world!');
assert.equal($('.ts-component').length, 1, 'Can use TS components');
+ assert.equal($('#pure').length, 1, 'Can use Pure components');
});
React('Includes reactroot on hydrating components', async () => {