diff --git a/app/javascript/article-form/components/ArticleCoverImage.jsx b/app/javascript/article-form/components/ArticleCoverImage.jsx
index 46419a67c..8caa0db7b 100644
--- a/app/javascript/article-form/components/ArticleCoverImage.jsx
+++ b/app/javascript/article-form/components/ArticleCoverImage.jsx
@@ -1,4 +1,4 @@
-import { h, Component } from 'preact';
+import { h, Component, Fragment } from 'preact';
import PropTypes from 'prop-types';
import { generateMainImage } from '../actions';
import { validateFileInputs } from '../../packs/validateFileInputs';
@@ -75,7 +75,7 @@ export class ArticleCoverImage extends Component {
Uploading...
) : (
- <>
+
)}
{uploadError && (
diff --git a/app/javascript/leftSidebar/TagsFollowed.jsx b/app/javascript/leftSidebar/TagsFollowed.jsx
index d3af77506..798b31fc0 100644
--- a/app/javascript/leftSidebar/TagsFollowed.jsx
+++ b/app/javascript/leftSidebar/TagsFollowed.jsx
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { tagPropTypes } from '../common-prop-types';
export const TagsFollowed = ({ tags = [] }) => {
- // TODO: Once we're using Preact X >, we can replace the containing
{tags.map((tag) => (
diff --git a/app/javascript/modCenter/singleArticle/__tests__/singleArticle.test.jsx b/app/javascript/modCenter/singleArticle/__tests__/singleArticle.test.jsx
index 2f4fc6fc1..0ead5094e 100644
--- a/app/javascript/modCenter/singleArticle/__tests__/singleArticle.test.jsx
+++ b/app/javascript/modCenter/singleArticle/__tests__/singleArticle.test.jsx
@@ -1,5 +1,5 @@
/* eslint-disable jest/expect-expect */
-import { h } from 'preact';
+import { h, Fragment } from 'preact';
import { axe } from 'jest-axe';
import { render, getNodeText } from '@testing-library/preact';
import SingleArticle from '../index';
@@ -19,14 +19,14 @@ const getTestArticle = () => ({
describe('
', () => {
it('should have no a11y violations', async () => {
const { container } = render(
- <>
+
{/* Div below needed for this test to pass while preserve FlagUserModal functionality */}
- >,
+ ,
);
const results = await axe(container);
expect(results).toHaveNoViolations();
@@ -34,13 +34,13 @@ describe('
', () => {
it('renders the article title', () => {
const { queryByText } = render(
- <>
+
- >,
+ ,
);
expect(queryByText(getTestArticle().title)).toBeDefined();
@@ -48,13 +48,13 @@ describe('
', () => {
it('renders the tags', () => {
const { queryByText } = render(
- <>
+
- >,
+ ,
);
expect(queryByText('discuss')).toBeDefined();
@@ -77,13 +77,13 @@ describe('
', () => {
},
};
const { container } = render(
- <>
+
- >,
+ ,
);
const text = getNodeText(container.querySelector('.article-title'));
expect(text).not.toContain('#');
@@ -91,13 +91,13 @@ describe('
', () => {
it('renders the author name', () => {
const { container } = render(
- <>
+
- >,
+ ,
);
const text = getNodeText(container.querySelector('.article-author'));
expect(text).toContain(getTestArticle().user.name);
@@ -105,13 +105,13 @@ describe('
', () => {
it('renders the hand wave emoji if the author has less than 3 articles ', () => {
const { container } = render(
- <>
+
- >,
+ ,
);
const text = getNodeText(container.querySelector('.article-author'));
expect(text).toContain('👋');
@@ -119,13 +119,13 @@ describe('
', () => {
it('renders the correct formatted published date', () => {
const { queryByText } = render(
- <>
+
- >,
+ ,
);
expect(queryByText('Jun 22')).toBeDefined();
@@ -137,13 +137,13 @@ describe('
', () => {
article.publishedAt = publishDate.toISOString();
render(
- <>
+
- >,
+ ,
);
const readableTime = publishDate
@@ -161,13 +161,13 @@ describe('
', () => {
const toggleArticle = jest.fn();
const article = getTestArticle();
const { getByTestId } = render(
- <>
+
- >,
+ ,
);
const button = getByTestId(`mod-article-${article.id}`);
diff --git a/app/javascript/modCenter/singleArticle/index.jsx b/app/javascript/modCenter/singleArticle/index.jsx
index b56d5fcef..580c0ecdd 100644
--- a/app/javascript/modCenter/singleArticle/index.jsx
+++ b/app/javascript/modCenter/singleArticle/index.jsx
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types';
-import { h, Component } from 'preact';
+import { h, Component, Fragment } from 'preact';
import { createPortal } from 'preact/compat';
import { toggleFlagUserModal, FlagUserModal } from '../../packs/flagUserModal';
import { formatDate } from './util';
@@ -49,7 +49,7 @@ export default class SingleArticle extends Component {
}
return (
- <>
+
{modContainer &&
createPortal(
,
@@ -81,7 +81,7 @@ export default class SingleArticle extends Component {
id={`article-iframe-${id}`}
/>
- >
+
);
}
}