mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
[CORL-1074] Upgrade dependencies (#2999)
* chore: upgrade eslint, typescript * chore: upgrade deps * chore: revert upgrade ts-node-dev * chore: revert unneeded comments Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -30,4 +30,4 @@ async function main() {
|
||||
ReactDOM.render(<Index />, document.getElementById("app"));
|
||||
}
|
||||
|
||||
main();
|
||||
void main();
|
||||
|
||||
@@ -136,7 +136,7 @@ const ModerateCardContainer: FunctionComponent<Props> = ({
|
||||
|
||||
const { storyID, siteID, section } = parseModerationOptions(match);
|
||||
|
||||
featureComment({
|
||||
void featureComment({
|
||||
commentID: comment.id,
|
||||
commentRevisionID: comment.revision.id,
|
||||
storyID,
|
||||
@@ -146,7 +146,7 @@ const ModerateCardContainer: FunctionComponent<Props> = ({
|
||||
}, [featureComment, comment, match]);
|
||||
|
||||
const handleUnfeature = useCallback(() => {
|
||||
unfeatureComment({
|
||||
void unfeatureComment({
|
||||
commentID: comment.id,
|
||||
storyID: match.params.storyID,
|
||||
});
|
||||
|
||||
@@ -22,7 +22,7 @@ const ModeratorNote: FunctionComponent<Props> = ({
|
||||
}) => {
|
||||
const deleteNote = useCallback(() => {
|
||||
if (onDelete) {
|
||||
onDelete(id);
|
||||
void onDelete(id);
|
||||
}
|
||||
}, [id]);
|
||||
return (
|
||||
|
||||
@@ -33,7 +33,7 @@ const UserHistoryDrawerAllComments: FunctionComponent<Props> = ({
|
||||
return;
|
||||
}
|
||||
|
||||
loadMore();
|
||||
void loadMore();
|
||||
}, [loadMore]);
|
||||
|
||||
const hasMore = relay.hasMore();
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ const UserHistoryDrawerRejectedComments: FunctionComponent<Props> = ({
|
||||
return;
|
||||
}
|
||||
|
||||
loadMore();
|
||||
void loadMore();
|
||||
}, [loadMore]);
|
||||
|
||||
const hasMore = relay.hasMore();
|
||||
|
||||
@@ -25,7 +25,7 @@ const UserRoleChangeContainer: FunctionComponent<Props> = (props) => {
|
||||
if (role === props.user.role) {
|
||||
return;
|
||||
}
|
||||
updateUserRole({ userID: props.user.id, role });
|
||||
void updateUserRole({ userID: props.user.id, role });
|
||||
},
|
||||
[props.user.id, props.user.role, updateUserRole]
|
||||
);
|
||||
|
||||
@@ -48,7 +48,7 @@ const UserStatusChangeContainer: FunctionComponent<Props> = (props) => {
|
||||
if (!user.status.ban.active) {
|
||||
return;
|
||||
}
|
||||
removeUserBan({ userID: user.id });
|
||||
void removeUserBan({ userID: user.id });
|
||||
}, [user, removeUserBan]);
|
||||
const handleSuspend = useCallback(() => {
|
||||
if (user.status.suspension.active) {
|
||||
@@ -60,7 +60,7 @@ const UserStatusChangeContainer: FunctionComponent<Props> = (props) => {
|
||||
if (!user.status.suspension.active) {
|
||||
return;
|
||||
}
|
||||
removeUserSuspension({ userID: user.id });
|
||||
void removeUserSuspension({ userID: user.id });
|
||||
}, [user, removeUserSuspension]);
|
||||
|
||||
const handlePremod = useCallback(() => {
|
||||
@@ -71,7 +71,7 @@ const UserStatusChangeContainer: FunctionComponent<Props> = (props) => {
|
||||
}, [user, setShowPremod]);
|
||||
|
||||
const handlePremodConfirm = useCallback(() => {
|
||||
premodUser({ userID: user.id });
|
||||
void premodUser({ userID: user.id });
|
||||
setShowPremod(false);
|
||||
}, [premodUser, user, setShowPremod]);
|
||||
|
||||
@@ -83,7 +83,7 @@ const UserStatusChangeContainer: FunctionComponent<Props> = (props) => {
|
||||
if (!user.status.premod.active) {
|
||||
return;
|
||||
}
|
||||
removeUserPremod({ userID: user.id });
|
||||
void removeUserPremod({ userID: user.id });
|
||||
}, [user, premodUser]);
|
||||
|
||||
const handleSuspendModalClose = useCallback(() => {
|
||||
@@ -97,7 +97,7 @@ const UserStatusChangeContainer: FunctionComponent<Props> = (props) => {
|
||||
|
||||
const handleSuspendConfirm = useCallback(
|
||||
(timeout, message) => {
|
||||
suspendUser({
|
||||
void suspendUser({
|
||||
userID: user.id,
|
||||
timeout,
|
||||
message,
|
||||
@@ -109,7 +109,7 @@ const UserStatusChangeContainer: FunctionComponent<Props> = (props) => {
|
||||
|
||||
const handleBanConfirm = useCallback(
|
||||
(rejectExistingComments, message) => {
|
||||
banUser({ userID: user.id, message, rejectExistingComments });
|
||||
void banUser({ userID: user.id, message, rejectExistingComments });
|
||||
setShowBanned(false);
|
||||
},
|
||||
[user, setShowBanned]
|
||||
|
||||
@@ -32,4 +32,4 @@ async function main() {
|
||||
ReactDOM.render(<Index />, document.getElementById("app"));
|
||||
}
|
||||
|
||||
main();
|
||||
void main();
|
||||
|
||||
@@ -37,14 +37,14 @@ function createAuthCheckRoute(check: CheckParams) {
|
||||
private wasLoggedIn = false;
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
this.redirectIfNotLoggedIn();
|
||||
void this.redirectIfNotLoggedIn();
|
||||
}
|
||||
|
||||
public UNSAFE_componentWillReceiveProps(nextProps: Props) {
|
||||
if (nextProps.data && nextProps.data.viewer) {
|
||||
this.wasLoggedIn = true;
|
||||
}
|
||||
this.redirectIfNotLoggedIn(nextProps, this.props);
|
||||
void this.redirectIfNotLoggedIn(nextProps, this.props);
|
||||
if (nextProps.data && !nextProps.data.viewer) {
|
||||
this.wasLoggedIn = false;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class RestrictedContainer extends Component<Props> {
|
||||
await this.props.signOut();
|
||||
// Wait for new context to propagate.
|
||||
await timeout();
|
||||
this.props.setRedirectPath({
|
||||
void this.props.setRedirectPath({
|
||||
path: location.pathname + location.search + location.hash,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
withFetch,
|
||||
withFragmentContainer,
|
||||
} from "coral-framework/lib/relay";
|
||||
import { OmitRefType } from "coral-framework/types";
|
||||
|
||||
import { OIDCConfig_formValues } from "coral-admin/__generated__/OIDCConfig_formValues.graphql";
|
||||
import { OIDCConfigContainer_auth as AuthData } from "coral-admin/__generated__/OIDCConfigContainer_auth.graphql";
|
||||
@@ -19,7 +20,9 @@ interface Props {
|
||||
auth: AuthData;
|
||||
disabled?: boolean;
|
||||
discoverOIDCConfiguration: FetchProp<typeof DiscoverOIDCConfigurationFetch>;
|
||||
form: FormApi<{ auth: AuthData & OIDCConfig_formValues }>;
|
||||
form: FormApi<{
|
||||
auth: OmitRefType<AuthData> & OmitRefType<OIDCConfig_formValues>;
|
||||
}>;
|
||||
}
|
||||
|
||||
interface State {
|
||||
|
||||
+7
-7
@@ -87,30 +87,30 @@ const SSOSigningSecretCard: FunctionComponent<Props> = ({
|
||||
(rotation: string) => {
|
||||
switch (rotation) {
|
||||
case RotateOptions.NOW:
|
||||
rotateSSOSigningSecret({ inactiveIn: 0 });
|
||||
void rotateSSOSigningSecret({ inactiveIn: 0 });
|
||||
break;
|
||||
case RotateOptions.IN1DAY:
|
||||
rotateSSOSigningSecret({ inactiveIn: 24 * 60 * 60 });
|
||||
void rotateSSOSigningSecret({ inactiveIn: 24 * 60 * 60 });
|
||||
break;
|
||||
case RotateOptions.IN1WEEK:
|
||||
rotateSSOSigningSecret({ inactiveIn: 7 * 24 * 60 * 60 });
|
||||
void rotateSSOSigningSecret({ inactiveIn: 7 * 24 * 60 * 60 });
|
||||
break;
|
||||
case RotateOptions.IN30DAYS:
|
||||
rotateSSOSigningSecret({ inactiveIn: 30 * 24 * 60 * 60 });
|
||||
void rotateSSOSigningSecret({ inactiveIn: 30 * 24 * 60 * 60 });
|
||||
break;
|
||||
default:
|
||||
rotateSSOSigningSecret({ inactiveIn: 0 });
|
||||
void rotateSSOSigningSecret({ inactiveIn: 0 });
|
||||
}
|
||||
},
|
||||
[rotateSSOSigningSecret]
|
||||
);
|
||||
const onDeactivate = useCallback(() => {
|
||||
deactivateSSOSigningSecret({
|
||||
void deactivateSSOSigningSecret({
|
||||
kid: id,
|
||||
});
|
||||
}, [deactivateSSOSigningSecret, id]);
|
||||
const onDelete = useCallback(() => {
|
||||
deleteSSOSigningSecret({
|
||||
void deleteSSOSigningSecret({
|
||||
kid: id,
|
||||
});
|
||||
}, [deleteSSOSigningSecret, id]);
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ const AnnouncementConfigContainer: FunctionComponent<Props> = ({
|
||||
const onCreate = useCallback((values) => {
|
||||
try {
|
||||
setSubmitError(null);
|
||||
createAnnouncement(values);
|
||||
void createAnnouncement(values);
|
||||
setShowForm(false);
|
||||
} catch (error) {
|
||||
setSubmitError(error.message);
|
||||
@@ -47,7 +47,7 @@ const AnnouncementConfigContainer: FunctionComponent<Props> = ({
|
||||
const onDelete = useCallback(() => {
|
||||
try {
|
||||
setSubmitError(null);
|
||||
deleteAnnouncement();
|
||||
void deleteAnnouncement();
|
||||
} catch (error) {
|
||||
setSubmitError(error.message);
|
||||
setShowForm(false);
|
||||
|
||||
@@ -35,7 +35,7 @@ class GeneralConfigRoute extends React.Component<Props> {
|
||||
const enhanced = withRouteConfig<Props>({
|
||||
getQuery: () => {
|
||||
// Start prefetching markdown editor.
|
||||
loadMarkdownEditor();
|
||||
void loadMarkdownEditor();
|
||||
|
||||
// Fetch graphql data.
|
||||
return graphql`
|
||||
|
||||
@@ -108,7 +108,7 @@ const PerspectiveConfig: FunctionComponent<Props> = ({ disabled }) => {
|
||||
</Localized>
|
||||
<Localized
|
||||
id="configure-moderation-perspective-toxicityThresholdDescription"
|
||||
$default={TOXICITY_THRESHOLD_DEFAULT + "%"}
|
||||
$default={TOXICITY_THRESHOLD_DEFAULT.toString() + "%"}
|
||||
>
|
||||
<HelperText>
|
||||
This value can be set a percentage between 0 and 100. This number
|
||||
|
||||
@@ -70,7 +70,7 @@ function handleAccountCompletion(props: Props) {
|
||||
}
|
||||
} else {
|
||||
// all set, complete account.
|
||||
props
|
||||
void props
|
||||
.completeAccount({ accessToken: props.local.accessToken! })
|
||||
.then(() => {
|
||||
props.router.replace(props.local.redirectPath || "/admin");
|
||||
|
||||
@@ -31,7 +31,7 @@ const AddEmailAddress: FunctionComponent = () => {
|
||||
} catch (error) {
|
||||
if (error instanceof InvalidRequestError) {
|
||||
if (error.code === "DUPLICATE_EMAIL") {
|
||||
setDuplicateEmail({ duplicateEmail: input.email });
|
||||
void setDuplicateEmail({ duplicateEmail: input.email });
|
||||
setView({ view: "LINK_ACCOUNT" });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ export const QueueRoute: FunctionComponent<Props> = (props) => {
|
||||
);
|
||||
const viewNew = useMutation(QueueViewNewMutation);
|
||||
const onViewNew = useCallback(() => {
|
||||
viewNew({
|
||||
void viewNew({
|
||||
queue: props.queueName,
|
||||
storyID: props.storyID || null,
|
||||
siteID: props.siteID || null,
|
||||
|
||||
@@ -23,13 +23,13 @@ const StoryActionsContainer: FunctionComponent<Props> = (props) => {
|
||||
const closeStory = useMutation(CloseStoryMutation);
|
||||
const openStory = useMutation(OpenStoryMutation);
|
||||
const onRescrape = useCallback(() => {
|
||||
rescrape({ id: props.story.id });
|
||||
void rescrape({ id: props.story.id });
|
||||
}, [props.story.id]);
|
||||
const onClose = useCallback(() => {
|
||||
closeStory({ id: props.story.id });
|
||||
void closeStory({ id: props.story.id });
|
||||
}, [props.story.id]);
|
||||
const onOpen = useCallback(() => {
|
||||
openStory({ id: props.story.id });
|
||||
void openStory({ id: props.story.id });
|
||||
}, [props.story.id]);
|
||||
const canChangeStatus = can(props.viewer, Ability.CHANGE_STORY_STATUS);
|
||||
return (
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import TestRenderer from "react-test-renderer";
|
||||
import { v1 as uuid } from "uuid";
|
||||
|
||||
import { pureMerge } from "coral-common/utils";
|
||||
@@ -427,7 +426,7 @@ it("suspend user", async () => {
|
||||
selector: "tr",
|
||||
});
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(userRow).getByLabelText("Change user status").props.onClick();
|
||||
});
|
||||
|
||||
@@ -435,7 +434,7 @@ it("suspend user", async () => {
|
||||
"A dropdown to change the user status"
|
||||
);
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(popup).getByText("Suspend", { selector: "button" }).props.onClick();
|
||||
});
|
||||
|
||||
@@ -443,7 +442,7 @@ it("suspend user", async () => {
|
||||
exact: false,
|
||||
});
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(modal).getByType("form").props.onSubmit();
|
||||
});
|
||||
within(userRow).getByText("Suspended");
|
||||
@@ -490,7 +489,7 @@ it("remove user suspension", async () => {
|
||||
selector: "tr",
|
||||
});
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(userRow).getByLabelText("Change user status").props.onClick();
|
||||
});
|
||||
|
||||
@@ -498,7 +497,7 @@ it("remove user suspension", async () => {
|
||||
"A dropdown to change the user status"
|
||||
);
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(popup)
|
||||
.getByText("Remove suspension", { selector: "button" })
|
||||
.props.onClick();
|
||||
@@ -539,7 +538,7 @@ it("suspend user with custom timeout", async () => {
|
||||
selector: "tr",
|
||||
});
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(userRow).getByLabelText("Change user status").props.onClick();
|
||||
});
|
||||
|
||||
@@ -547,7 +546,7 @@ it("suspend user with custom timeout", async () => {
|
||||
"A dropdown to change the user status"
|
||||
);
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(popup).getByText("Suspend", { selector: "button" }).props.onClick();
|
||||
});
|
||||
|
||||
@@ -557,11 +556,11 @@ it("suspend user with custom timeout", async () => {
|
||||
|
||||
const changedDuration = within(modal).getByID("duration-604800");
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
changedDuration.props.onChange(changedDuration.props.value.toString());
|
||||
});
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(modal).getByType("form").props.onSubmit();
|
||||
});
|
||||
within(userRow).getByText("Suspended");
|
||||
@@ -599,7 +598,7 @@ it("suspend user with custom message", async () => {
|
||||
selector: "tr",
|
||||
});
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(userRow).getByLabelText("Change user status").props.onClick();
|
||||
});
|
||||
|
||||
@@ -607,7 +606,7 @@ it("suspend user with custom message", async () => {
|
||||
"A dropdown to change the user status"
|
||||
);
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(popup).getByText("Suspend", { selector: "button" }).props.onClick();
|
||||
});
|
||||
|
||||
@@ -617,17 +616,17 @@ it("suspend user with custom message", async () => {
|
||||
|
||||
const toggleEdit = within(modal).getByID("suspendModal-editMessage");
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
toggleEdit.props.onChange(true);
|
||||
});
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(modal)
|
||||
.getByID("suspendModal-message")
|
||||
.props.onChange("YOU WERE SUSPENDED FOR BEHAVING BADLY");
|
||||
});
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(modal).getByType("form").props.onSubmit();
|
||||
});
|
||||
|
||||
@@ -665,7 +664,7 @@ it("ban user", async () => {
|
||||
selector: "tr",
|
||||
});
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(userRow).getByLabelText("Change user status").props.onClick();
|
||||
});
|
||||
|
||||
@@ -673,7 +672,7 @@ it("ban user", async () => {
|
||||
"A dropdown to change the user status"
|
||||
);
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(popup).getByText("Ban", { selector: "button" }).props.onClick();
|
||||
});
|
||||
|
||||
@@ -684,7 +683,7 @@ it("ban user", async () => {
|
||||
}
|
||||
);
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(modal).getByType("form").props.onSubmit();
|
||||
});
|
||||
within(userRow).getByText("Banned");
|
||||
@@ -722,7 +721,7 @@ it("ban user with custom message", async () => {
|
||||
selector: "tr",
|
||||
});
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(userRow).getByLabelText("Change user status").props.onClick();
|
||||
});
|
||||
|
||||
@@ -730,7 +729,7 @@ it("ban user with custom message", async () => {
|
||||
"A dropdown to change the user status"
|
||||
);
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(popup).getByText("Ban", { selector: "button" }).props.onClick();
|
||||
});
|
||||
|
||||
@@ -743,17 +742,17 @@ it("ban user with custom message", async () => {
|
||||
|
||||
const toggleMessage = within(modal).getByID("banModal-showMessage");
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
toggleMessage.props.onChange(true);
|
||||
});
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(modal)
|
||||
.getByID("banModal-message")
|
||||
.props.onChange("YOU WERE BANNED FOR BREAKING THE RULES");
|
||||
});
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(modal).getByType("form").props.onSubmit();
|
||||
});
|
||||
within(userRow).getByText("Banned");
|
||||
@@ -802,7 +801,7 @@ it("remove user ban", async () => {
|
||||
selector: "tr",
|
||||
});
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(userRow).getByLabelText("Change user status").props.onClick();
|
||||
});
|
||||
|
||||
@@ -810,7 +809,7 @@ it("remove user ban", async () => {
|
||||
"A dropdown to change the user status"
|
||||
);
|
||||
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
within(popup)
|
||||
.getByText("Remove ban", { selector: "button" })
|
||||
.props.onClick();
|
||||
|
||||
@@ -204,14 +204,13 @@ it("prevents stream lock out", async () => {
|
||||
window.confirm = stubCancel;
|
||||
// Let's disable stream target in local auth.
|
||||
act(() => streamTarget.props.onChange(false));
|
||||
within(streamTarget).debug();
|
||||
|
||||
// Send form
|
||||
await act(async () => await form.props.onSubmit());
|
||||
|
||||
// Submit button should not be disabled because we canceled the submit.
|
||||
wait(() => expect(saveChanges.props.disabled).toBe(true));
|
||||
wait(() => {
|
||||
await wait(() => expect(saveChanges.props.disabled).toBe(false));
|
||||
await wait(() => {
|
||||
expect(stubCancel.calledOnce).toBe(true);
|
||||
});
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ function handleAccountCompletion(props: Props) {
|
||||
return false;
|
||||
}
|
||||
// all set, complete account.
|
||||
completeAccount({ accessToken: accessToken! });
|
||||
void completeAccount({ accessToken: accessToken! });
|
||||
|
||||
// account completed.
|
||||
return true;
|
||||
|
||||
@@ -30,4 +30,4 @@ async function main() {
|
||||
ReactDOM.render(<Index />, document.getElementById("app"));
|
||||
}
|
||||
|
||||
main();
|
||||
void main();
|
||||
|
||||
@@ -234,7 +234,7 @@ it("shows server error", async () => {
|
||||
expect(submitButton.props.disabled).toBe(true);
|
||||
|
||||
await act(async () => {
|
||||
wait(() => expect(submitButton.props.disabled).toBe(false));
|
||||
await wait(() => expect(submitButton.props.disabled).toBe(false));
|
||||
});
|
||||
|
||||
within(main).getByText("Server Error");
|
||||
|
||||
@@ -44,7 +44,7 @@ const SignInContainer: FunctionComponent<Props> = ({
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
// Clear the error when we unmount.
|
||||
clearError();
|
||||
void clearError();
|
||||
};
|
||||
}, [clearError, auth]);
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ function createManagedCoralContextProvider(
|
||||
// This is called every time a user session starts or ends.
|
||||
private clearSession = async (nextAccessToken?: string) => {
|
||||
// Clear session storage.
|
||||
this.state.context.sessionStorage.clear();
|
||||
void this.state.context.sessionStorage.clear();
|
||||
|
||||
// Pause subscriptions.
|
||||
subscriptionClient.pause();
|
||||
|
||||
@@ -93,7 +93,7 @@ export function useImmediateFetch<V extends {}, R>(
|
||||
}, 100 + 50 * Math.random());
|
||||
}
|
||||
|
||||
doTheFetch();
|
||||
void doTheFetch();
|
||||
}, Object.values(variables).concat(isUndefined(refetch) ? [] : [refetch]));
|
||||
|
||||
return [state, loading];
|
||||
|
||||
@@ -5,22 +5,22 @@ it("should set and unset values", async () => {
|
||||
const storage = createPromisifiedStorage(createInMemoryStorage());
|
||||
await expect(storage.setItem("test", "value")).resolves.toBeUndefined();
|
||||
await expect(storage.getItem("test")).resolves.toBe("value");
|
||||
storage.removeItem("test");
|
||||
await storage.removeItem("test");
|
||||
await expect(storage.getItem("test")).resolves.toBeNull();
|
||||
});
|
||||
|
||||
it("should return length", async () => {
|
||||
const storage = createPromisifiedStorage(createInMemoryStorage());
|
||||
storage.setItem("a", "value");
|
||||
storage.setItem("b", "value");
|
||||
storage.setItem("c", "value");
|
||||
await storage.setItem("a", "value");
|
||||
await storage.setItem("b", "value");
|
||||
await storage.setItem("c", "value");
|
||||
await expect(storage.length).resolves.toBe(3);
|
||||
});
|
||||
|
||||
it("should nth value", async () => {
|
||||
const storage = createPromisifiedStorage(createInMemoryStorage());
|
||||
storage.setItem("a", "a");
|
||||
storage.setItem("b", "b");
|
||||
storage.setItem("c", "c");
|
||||
await storage.setItem("a", "a");
|
||||
await storage.setItem("b", "b");
|
||||
await storage.setItem("c", "c");
|
||||
await expect(storage.key(2)).resolves.toBe("c");
|
||||
});
|
||||
|
||||
@@ -18,7 +18,7 @@ class PymStub {
|
||||
}
|
||||
|
||||
describe("PymStorage", () => {
|
||||
it("should set item", () => {
|
||||
it("should set item", async () => {
|
||||
const pym = new PymStub("localStorage");
|
||||
const storage = createPymStorage(pym as any, "localStorage");
|
||||
const promise = storage.setItem("test", "value");
|
||||
@@ -28,10 +28,10 @@ describe("PymStorage", () => {
|
||||
expect(method).toBe("setItem");
|
||||
expect(parameters).toEqual({ key: "test", value: "value" });
|
||||
pym.listeners["pymStorage.localStorage.response"](JSON.stringify({ id }));
|
||||
expect(promise).resolves.toBeUndefined();
|
||||
await expect(promise).resolves.toBeUndefined();
|
||||
});
|
||||
|
||||
it("should remove item", () => {
|
||||
it("should remove item", async () => {
|
||||
const pym = new PymStub("localStorage");
|
||||
const storage = createPymStorage(pym as any, "localStorage");
|
||||
const promise = storage.removeItem("test");
|
||||
@@ -41,10 +41,10 @@ describe("PymStorage", () => {
|
||||
expect(method).toBe("removeItem");
|
||||
expect(parameters).toEqual({ key: "test" });
|
||||
pym.listeners["pymStorage.localStorage.response"](JSON.stringify({ id }));
|
||||
expect(promise).resolves.toBeUndefined();
|
||||
await expect(promise).resolves.toBeUndefined();
|
||||
});
|
||||
|
||||
it("should get item", () => {
|
||||
it("should get item", async () => {
|
||||
const pym = new PymStub("localStorage");
|
||||
const storage = createPymStorage(pym as any, "localStorage");
|
||||
const promise = storage.getItem("test");
|
||||
@@ -56,10 +56,10 @@ describe("PymStorage", () => {
|
||||
pym.listeners["pymStorage.localStorage.response"](
|
||||
JSON.stringify({ id, result: "value" })
|
||||
);
|
||||
expect(promise).resolves.toBe("value");
|
||||
await expect(promise).resolves.toBe("value");
|
||||
});
|
||||
|
||||
it("should get length", () => {
|
||||
it("should get length", async () => {
|
||||
const pym = new PymStub("localStorage");
|
||||
const storage = createPymStorage(pym as any, "localStorage");
|
||||
const promise = storage.length;
|
||||
@@ -71,10 +71,10 @@ describe("PymStorage", () => {
|
||||
pym.listeners["pymStorage.localStorage.response"](
|
||||
JSON.stringify({ id, result: 3 })
|
||||
);
|
||||
expect(promise).resolves.toBe(3);
|
||||
await expect(promise).resolves.toBe(3);
|
||||
});
|
||||
|
||||
it("should get key", () => {
|
||||
it("should get key", async () => {
|
||||
const pym = new PymStub("localStorage");
|
||||
const storage = createPymStorage(pym as any, "localStorage");
|
||||
const promise = storage.key(2);
|
||||
@@ -86,10 +86,10 @@ describe("PymStorage", () => {
|
||||
pym.listeners["pymStorage.localStorage.response"](
|
||||
JSON.stringify({ id, result: "myKey" })
|
||||
);
|
||||
expect(promise).resolves.toBe("myKey");
|
||||
await expect(promise).resolves.toBe("myKey");
|
||||
});
|
||||
|
||||
it("should clear", () => {
|
||||
it("should clear", async () => {
|
||||
const pym = new PymStub("localStorage");
|
||||
const storage = createPymStorage(pym as any, "localStorage");
|
||||
const promise = storage.clear();
|
||||
@@ -99,11 +99,11 @@ describe("PymStorage", () => {
|
||||
expect(method).toBe("clear");
|
||||
expect(parameters).toEqual({});
|
||||
pym.listeners["pymStorage.localStorage.response"](JSON.stringify({ id }));
|
||||
expect(promise).resolves.toBeUndefined();
|
||||
await expect(promise).resolves.toBeUndefined();
|
||||
});
|
||||
|
||||
describe("on error", () => {
|
||||
it("should reject set item", () => {
|
||||
it("should reject set item", async () => {
|
||||
const pym = new PymStub("localStorage");
|
||||
const storage = createPymStorage(pym as any, "localStorage");
|
||||
const promise = storage.setItem("test", "value");
|
||||
@@ -113,9 +113,9 @@ describe("PymStorage", () => {
|
||||
pym.listeners["pymStorage.localStorage.error"](
|
||||
JSON.stringify({ id, error: "error" })
|
||||
);
|
||||
expect(promise).rejects.toThrow(new Error("error"));
|
||||
await expect(promise).rejects.toThrow(new Error("error"));
|
||||
});
|
||||
it("should reject remove item", () => {
|
||||
it("should reject remove item", async () => {
|
||||
const pym = new PymStub("localStorage");
|
||||
const storage = createPymStorage(pym as any, "localStorage");
|
||||
const promise = storage.removeItem("test");
|
||||
@@ -125,9 +125,9 @@ describe("PymStorage", () => {
|
||||
pym.listeners["pymStorage.localStorage.error"](
|
||||
JSON.stringify({ id, error: "error" })
|
||||
);
|
||||
expect(promise).rejects.toThrow(new Error("error"));
|
||||
await expect(promise).rejects.toThrow(new Error("error"));
|
||||
});
|
||||
it("should reject get item", () => {
|
||||
it("should reject get item", async () => {
|
||||
const pym = new PymStub("localStorage");
|
||||
const storage = createPymStorage(pym as any, "localStorage");
|
||||
const promise = storage.getItem("test");
|
||||
@@ -137,7 +137,7 @@ describe("PymStorage", () => {
|
||||
pym.listeners["pymStorage.localStorage.error"](
|
||||
JSON.stringify({ id, error: "error" })
|
||||
);
|
||||
expect(promise).rejects.toThrow(new Error("error"));
|
||||
await expect(promise).rejects.toThrow(new Error("error"));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
import { PostMessageService } from "coral-framework/lib/postMessage";
|
||||
import { RestClient } from "coral-framework/lib/rest";
|
||||
import { createPromisifiedStorage } from "coral-framework/lib/storage";
|
||||
import { createUUIDGenerator } from "coral-framework/testHelpers";
|
||||
import { act, createUUIDGenerator } from "coral-framework/testHelpers";
|
||||
|
||||
import createFluentBundle from "./createFluentBundle";
|
||||
import createRelayEnvironment from "./createRelayEnvironment";
|
||||
@@ -35,8 +35,8 @@ export interface Resolvers<Q extends Resolver<any, any> = any, M = any> {
|
||||
}
|
||||
|
||||
export interface TestResolvers<T extends Resolvers = any> {
|
||||
Query?: { [P in keyof Required<T>["Query"]]: () => any };
|
||||
Mutation?: { [P in keyof Required<T>["Mutation"]]: () => any };
|
||||
Query?: { [P in keyof Required<T>["Query"]]?: () => any };
|
||||
Mutation?: { [P in keyof Required<T>["Mutation"]]?: () => any };
|
||||
}
|
||||
|
||||
function createNodeMock(element: React.ReactElement<any>) {
|
||||
@@ -111,7 +111,7 @@ export default function createTestRenderer<
|
||||
};
|
||||
|
||||
let testRenderer: ReactTestRenderer;
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer = TestRenderer.create(
|
||||
<CoralContextProvider value={context}>{element}</CoralContextProvider>,
|
||||
{ createNodeMock }
|
||||
|
||||
@@ -3,3 +3,4 @@ export { Overwrite, PropTypesOf } from "coral-ui/types";
|
||||
export { DeepPartial } from "coral-common/types";
|
||||
|
||||
export type RelayEnumLiteral<T> = keyof T | "%future added value";
|
||||
export type OmitRefType<T> = Omit<T, " $refType">;
|
||||
|
||||
@@ -33,7 +33,7 @@ const App: FunctionComponent = () => {
|
||||
}
|
||||
}
|
||||
|
||||
check();
|
||||
void check();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
@@ -30,4 +30,4 @@ async function main() {
|
||||
ReactDOM.render(<Index />, document.getElementById("app"));
|
||||
}
|
||||
|
||||
main();
|
||||
void main();
|
||||
|
||||
@@ -16,12 +16,12 @@ beforeAll(() => {
|
||||
});
|
||||
});
|
||||
|
||||
it("Sets activeTab", () => {
|
||||
it("Sets activeTab", async () => {
|
||||
const tab = "COMMENTS";
|
||||
const eventEmitter = new EventEmitter2();
|
||||
const mock = sinon.mock(eventEmitter);
|
||||
mock.expects("emit").withArgs("setMainTab", { tab });
|
||||
commit(environment, { tab }, { eventEmitter });
|
||||
await commit(environment, { tab }, { eventEmitter });
|
||||
expect(source.get(LOCAL_ID)!.activeTab).toEqual(tab);
|
||||
mock.verify();
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ interface Props {
|
||||
|
||||
export class TabBarContainer extends Component<Props> {
|
||||
private handleSetActiveTab = (tab: SetActiveTabInput["tab"]) => {
|
||||
this.props.setActiveTab({ tab });
|
||||
void this.props.setActiveTab({ tab });
|
||||
};
|
||||
|
||||
public render() {
|
||||
|
||||
@@ -16,7 +16,7 @@ export class OnPostMessageSetAccessToken extends Component<Props> {
|
||||
super(props);
|
||||
// Auth popup will use this to handle a successful login.
|
||||
props.postMessage.on("setAccessToken", (accessToken: string) => {
|
||||
props.setAccessToken({ accessToken });
|
||||
void props.setAccessToken({ accessToken });
|
||||
SignedInEvent.emit(props.eventEmitter);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ export class OnPymLogin extends Component<Props> {
|
||||
|
||||
// Sets comment id through pym.
|
||||
props.pym.onMessage("login", (accessToken) => {
|
||||
this.props.setAccessToken({ accessToken });
|
||||
void this.props.setAccessToken({ accessToken });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ export class OnPymLogout extends Component<Props> {
|
||||
|
||||
// Sets comment id through pym.
|
||||
props.pym.onMessage("logout", (accessToken) => {
|
||||
this.props.signOut();
|
||||
void this.props.signOut();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -20,14 +20,14 @@ beforeAll(() => {
|
||||
});
|
||||
});
|
||||
|
||||
it("sets state", () => {
|
||||
commit(environment, { open: true, focus: false });
|
||||
it("sets state", async () => {
|
||||
await commit(environment, { open: true, focus: false });
|
||||
expect(source.get(AUTH_POPUP_ID)!.open).toEqual(true);
|
||||
expect(source.get(AUTH_POPUP_ID)!.focus).toEqual(false);
|
||||
});
|
||||
|
||||
it("sets state", () => {
|
||||
commit(environment, {
|
||||
it("sets state", async () => {
|
||||
await commit(environment, {
|
||||
open: false,
|
||||
focus: true,
|
||||
href: "https://coralproject.net",
|
||||
@@ -37,16 +37,16 @@ it("sets state", () => {
|
||||
expect(source.get(AUTH_POPUP_ID)!.href).toEqual("https://coralproject.net");
|
||||
});
|
||||
|
||||
it("keep previous state", () => {
|
||||
commit(environment, { open: false, focus: true });
|
||||
commit(environment, {});
|
||||
it("keep previous state", async () => {
|
||||
await commit(environment, { open: false, focus: true });
|
||||
await commit(environment, {});
|
||||
expect(source.get(AUTH_POPUP_ID)!.open).toEqual(false);
|
||||
expect(source.get(AUTH_POPUP_ID)!.focus).toEqual(true);
|
||||
});
|
||||
|
||||
it("change only one", () => {
|
||||
commit(environment, { open: false, focus: true });
|
||||
commit(environment, { open: true });
|
||||
it("change only one", async () => {
|
||||
await commit(environment, { open: false, focus: true });
|
||||
await commit(environment, { open: true });
|
||||
expect(source.get(AUTH_POPUP_ID)!.open).toEqual(true);
|
||||
expect(source.get(AUTH_POPUP_ID)!.focus).toEqual(true);
|
||||
});
|
||||
|
||||
@@ -22,7 +22,7 @@ const useHandleIncompleteAccount = () => {
|
||||
) {
|
||||
// eslint-disable-next-line
|
||||
console.log("Coral: User account is incomplete. Perform logout.")
|
||||
signOut();
|
||||
void signOut();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -35,4 +35,4 @@ async function main() {
|
||||
ReactDOM.render(<Index />, document.getElementById("app"));
|
||||
}
|
||||
|
||||
main();
|
||||
void main();
|
||||
|
||||
@@ -24,9 +24,9 @@ afterEach(() => {
|
||||
window.history.replaceState(previousState, document.title, previousLocation);
|
||||
});
|
||||
|
||||
it("Sets comment id", () => {
|
||||
it("Sets comment id", async () => {
|
||||
const id = "comment1-id";
|
||||
commit(environment, { id }, {} as any);
|
||||
await commit(environment, { id }, {} as any);
|
||||
expect(source.get(LOCAL_ID)!.commentID).toEqual(id);
|
||||
expect(parseQuery(location.search).commentID).toEqual(id);
|
||||
});
|
||||
@@ -38,7 +38,7 @@ it("Should call setCommentID in pym", async () => {
|
||||
sendMessage: sinon.mock().once().withArgs("setCommentID", id),
|
||||
},
|
||||
};
|
||||
commit(environment, { id }, context as any);
|
||||
await commit(environment, { id }, context as any);
|
||||
await timeout();
|
||||
expect(source.get(LOCAL_ID)!.commentID).toEqual(id);
|
||||
context.pym.sendMessage.verify();
|
||||
@@ -50,7 +50,7 @@ it("Should call setCommentID in pym with empty id", async () => {
|
||||
sendMessage: sinon.mock().once().withArgs("setCommentID", ""),
|
||||
},
|
||||
};
|
||||
commit(environment, { id: null }, context as any);
|
||||
await commit(environment, { id: null }, context as any);
|
||||
await timeout();
|
||||
expect(source.get(LOCAL_ID)!.commentID).toEqual(null);
|
||||
expect(parseQuery(location.search).commentID).toBeUndefined();
|
||||
|
||||
@@ -23,36 +23,36 @@ beforeEach(() => {
|
||||
});
|
||||
});
|
||||
|
||||
it("emits ShowAuthPopupEvent and LoginPromptEvent on SIGN_IN", () => {
|
||||
it("emits ShowAuthPopupEvent and LoginPromptEvent on SIGN_IN", async () => {
|
||||
const view = "SIGN_IN";
|
||||
const eventEmitter = new EventEmitter2();
|
||||
const mock = sinon.mock(eventEmitter);
|
||||
mock.expects("emit").withArgs("loginPrompt");
|
||||
mock.expects("emit").withArgs("showAuthPopup", { view });
|
||||
commit(environment, { view }, { eventEmitter });
|
||||
await commit(environment, { view }, { eventEmitter });
|
||||
mock.verify();
|
||||
});
|
||||
|
||||
it("emits only ShowAuthPopupEvent on other views", () => {
|
||||
it("emits only ShowAuthPopupEvent on other views", async () => {
|
||||
const view = "FORGOT_PASSWORD";
|
||||
const eventEmitter = new EventEmitter2();
|
||||
const mock = sinon.mock(eventEmitter);
|
||||
mock.expects("emit").withArgs("showAuthPopup", { view });
|
||||
commit(environment, { view }, { eventEmitter });
|
||||
await commit(environment, { view }, { eventEmitter });
|
||||
mock.verify();
|
||||
});
|
||||
|
||||
it("opens popup or focus if already open", () => {
|
||||
it("opens popup or focus if already open", async () => {
|
||||
const view = "SIGN_IN";
|
||||
const context = {
|
||||
eventEmitter: new EventEmitter2(),
|
||||
};
|
||||
commit(environment, { view }, context);
|
||||
await commit(environment, { view }, context);
|
||||
expect(source.get(AUTH_POPUP_ID)!.open).toEqual(true);
|
||||
expect(source.get(AUTH_POPUP_ID)!.focus).toEqual(false);
|
||||
expect(source.get(AUTH_POPUP_ID)!.view).toEqual("SIGN_IN");
|
||||
|
||||
commit(environment, { view }, context);
|
||||
await commit(environment, { view }, context);
|
||||
expect(source.get(AUTH_POPUP_ID)!.open).toEqual(true);
|
||||
expect(source.get(AUTH_POPUP_ID)!.focus).toEqual(true);
|
||||
});
|
||||
|
||||
@@ -144,7 +144,7 @@ export class CommentContainer extends Component<Props, State> {
|
||||
};
|
||||
});
|
||||
} else {
|
||||
this.props.showAuthPopup({ view: "SIGN_IN" });
|
||||
void this.props.showAuthPopup({ view: "SIGN_IN" });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -157,7 +157,7 @@ export class CommentContainer extends Component<Props, State> {
|
||||
showEditDialog: true,
|
||||
}));
|
||||
} else {
|
||||
this.props.showAuthPopup({ view: "SIGN_IN" });
|
||||
void this.props.showAuthPopup({ view: "SIGN_IN" });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -189,7 +189,7 @@ export class CommentContainer extends Component<Props, State> {
|
||||
from: "COMMENT_STREAM",
|
||||
});
|
||||
e.preventDefault();
|
||||
this.props.setCommentID({ id: this.props.comment.id });
|
||||
void this.props.setCommentID({ id: this.props.comment.id });
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
+6
-3
@@ -51,7 +51,10 @@ const ModerationActionsContainer: FunctionComponent<Props> = ({
|
||||
if (!comment.revision) {
|
||||
return;
|
||||
}
|
||||
approve({ commentID: comment.id, commentRevisionID: comment.revision.id });
|
||||
void approve({
|
||||
commentID: comment.id,
|
||||
commentRevisionID: comment.revision.id,
|
||||
});
|
||||
}, [approve, comment]);
|
||||
const onReject = useCallback(async () => {
|
||||
if (!comment.revision) {
|
||||
@@ -67,7 +70,7 @@ const ModerationActionsContainer: FunctionComponent<Props> = ({
|
||||
if (!comment.revision) {
|
||||
return;
|
||||
}
|
||||
feature({
|
||||
void feature({
|
||||
storyID: story.id,
|
||||
commentID: comment.id,
|
||||
commentRevisionID: comment.revision.id,
|
||||
@@ -75,7 +78,7 @@ const ModerationActionsContainer: FunctionComponent<Props> = ({
|
||||
onDismiss();
|
||||
}, [feature, onDismiss, story, comment]);
|
||||
const onUnfeature = useCallback(() => {
|
||||
unfeature({
|
||||
void unfeature({
|
||||
commentID: comment.id,
|
||||
storyID: story.id,
|
||||
});
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ async function commit(
|
||||
},
|
||||
actionCounts: {
|
||||
reaction: {
|
||||
total: currentCount + 1,
|
||||
total: (currentCount as number) + 1,
|
||||
},
|
||||
},
|
||||
} as any,
|
||||
|
||||
+8
-5
@@ -65,7 +65,7 @@ export class ReplyCommentFormContainer extends Component<Props, State> {
|
||||
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
this.init();
|
||||
void this.init();
|
||||
}
|
||||
|
||||
private handleRTERef = (rte: CoralRTE | null) => {
|
||||
@@ -91,7 +91,7 @@ export class ReplyCommentFormContainer extends Component<Props, State> {
|
||||
}
|
||||
|
||||
private handleOnCancelOrDismiss = () => {
|
||||
this.props.sessionStorage.removeItem(this.contextKey);
|
||||
void this.props.sessionStorage.removeItem(this.contextKey);
|
||||
if (this.props.onClose) {
|
||||
this.props.onClose();
|
||||
}
|
||||
@@ -119,7 +119,7 @@ export class ReplyCommentFormContainer extends Component<Props, State> {
|
||||
})
|
||||
);
|
||||
if (submitStatus !== "RETRY") {
|
||||
this.props.sessionStorage.removeItem(this.contextKey);
|
||||
void this.props.sessionStorage.removeItem(this.contextKey);
|
||||
if (submitStatus === "APPROVED" && this.props.onClose) {
|
||||
this.props.onClose();
|
||||
return;
|
||||
@@ -150,9 +150,12 @@ export class ReplyCommentFormContainer extends Component<Props, State> {
|
||||
|
||||
private handleOnChange: ReplyCommentFormProps["onChange"] = (state, form) => {
|
||||
if (state.values.body) {
|
||||
this.props.sessionStorage.setItem(this.contextKey, state.values.body);
|
||||
void this.props.sessionStorage.setItem(
|
||||
this.contextKey,
|
||||
state.values.body
|
||||
);
|
||||
} else {
|
||||
this.props.sessionStorage.removeItem(this.contextKey);
|
||||
void this.props.sessionStorage.removeItem(this.contextKey);
|
||||
}
|
||||
// Reset errors whenever user clears the form.
|
||||
if (state.touched && state.touched.body && !state.values.body) {
|
||||
|
||||
@@ -50,7 +50,7 @@ const ReportButton: FunctionComponent<Props> = ({
|
||||
}, [comment]);
|
||||
|
||||
const signIn = useCallback(() => {
|
||||
showAuthPopup({ view: "SIGN_IN" });
|
||||
void showAuthPopup({ view: "SIGN_IN" });
|
||||
}, [showAuthPopup]);
|
||||
|
||||
if (isReported) {
|
||||
|
||||
@@ -44,7 +44,7 @@ const ShowConversationLink: FunctionComponent<ShowConversationLinkProps> = (
|
||||
target="_parent"
|
||||
anchor
|
||||
>
|
||||
Read More of this Conversation >
|
||||
Read More of this Conversation >
|
||||
</Button>
|
||||
</Localized>
|
||||
);
|
||||
|
||||
+2
-2
@@ -35,7 +35,7 @@ const UserBanPopoverContainer: FunctionComponent<Props> = ({
|
||||
const { localeBundles } = useCoralContext();
|
||||
|
||||
const onBan = useCallback(() => {
|
||||
banUser({
|
||||
void banUser({
|
||||
userID: user.id,
|
||||
commentID: comment.id,
|
||||
rejectExistingComments: false,
|
||||
@@ -47,7 +47,7 @@ const UserBanPopoverContainer: FunctionComponent<Props> = ({
|
||||
),
|
||||
});
|
||||
if (!rejected && comment.revision) {
|
||||
reject({
|
||||
void reject({
|
||||
commentID: comment.id,
|
||||
commentRevisionID: comment.revision.id,
|
||||
storyID: story.id,
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ export const UserIgnorePopoverContainer: FunctionComponent<Props> = ({
|
||||
}) => {
|
||||
const ignoreUser = useMutation(IgnoreUserMutation);
|
||||
const onIgnore = useCallback(() => {
|
||||
ignoreUser({ userID: user.id });
|
||||
void ignoreUser({ userID: user.id });
|
||||
onDismiss();
|
||||
}, [user.id, ignoreUser]);
|
||||
return (
|
||||
|
||||
@@ -36,7 +36,7 @@ class PermalinkViewContainer extends React.Component<
|
||||
ViewFullDiscussionEvent.emit(this.props.eventEmitter, {
|
||||
commentID: this.props.comment && this.props.comment.id,
|
||||
});
|
||||
this.props.setCommentID({ id: null });
|
||||
void this.props.setCommentID({ id: null });
|
||||
e.preventDefault();
|
||||
};
|
||||
private getShowAllCommentsHref() {
|
||||
|
||||
@@ -107,7 +107,7 @@ export const ReplyListContainer: React.FunctionComponent<Props> = (props) => {
|
||||
|
||||
const viewNew = useMutation(ReplyListViewNewMutation);
|
||||
const onViewNew = useCallback(() => {
|
||||
viewNew({ commentID: props.comment.id });
|
||||
void viewNew({ commentID: props.comment.id });
|
||||
}, [props.comment.id, viewNew]);
|
||||
|
||||
const viewNewCount =
|
||||
|
||||
@@ -32,7 +32,7 @@ export const AnnouncementContainer: FunctionComponent<Props> = ({
|
||||
}
|
||||
}
|
||||
}
|
||||
getDismissedStatus();
|
||||
void getDismissedStatus();
|
||||
}, [settings]);
|
||||
const dismissAnnouncement = useCallback(async () => {
|
||||
if (settings.announcement) {
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ const AnsweredCommentContainer: FunctionComponent<Props> = (props) => {
|
||||
from: "FEATURED_COMMENTS",
|
||||
commentID: comment.id,
|
||||
});
|
||||
setCommentID({ id: comment.id });
|
||||
void setCommentID({ id: comment.id });
|
||||
return false;
|
||||
},
|
||||
[setCommentID, comment]
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ const StreamDeletionRequestCalloutContainer: FunctionComponent<Props> = ({
|
||||
|
||||
const cancelAccountDeletion = useMutation(CancelAccountDeletionMutation);
|
||||
const cancelDeletion = useCallback(() => {
|
||||
cancelAccountDeletion();
|
||||
void cancelAccountDeletion();
|
||||
}, [cancelAccountDeletion]);
|
||||
|
||||
const deletionDate = viewer.scheduledDeletionDate
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ const FeaturedCommentContainer: FunctionComponent<Props> = (props) => {
|
||||
from: "FEATURED_COMMENTS",
|
||||
commentID: comment.id,
|
||||
});
|
||||
setCommentID({ id: comment.id });
|
||||
void setCommentID({ id: comment.id });
|
||||
return false;
|
||||
},
|
||||
[setCommentID, comment]
|
||||
|
||||
+3
-3
@@ -92,7 +92,7 @@ export class PostCommentFormContainer extends Component<Props, State> {
|
||||
// Restore comment draft, if available.
|
||||
this.state.notLoggedInDraft = preserveNotLoggedInDraft;
|
||||
preserveNotLoggedInDraft = "";
|
||||
this.init();
|
||||
void this.init();
|
||||
}
|
||||
|
||||
public componentWillUnmount() {
|
||||
@@ -168,9 +168,9 @@ export class PostCommentFormContainer extends Component<Props, State> {
|
||||
this.setState({ submitStatus: null });
|
||||
}
|
||||
if (state.values.body) {
|
||||
this.props.sessionStorage.setItem(contextKey, state.values.body);
|
||||
void this.props.sessionStorage.setItem(contextKey, state.values.body);
|
||||
} else {
|
||||
this.props.sessionStorage.removeItem(contextKey);
|
||||
void this.props.sessionStorage.removeItem(contextKey);
|
||||
}
|
||||
|
||||
// Reset errors whenever user clears the form.
|
||||
|
||||
+4
-1
@@ -49,7 +49,10 @@ class StoryClosedTimeoutContainer extends React.Component<Props> {
|
||||
|
||||
private handleClose = () => {
|
||||
this.timer = null;
|
||||
this.props.setStoryClosed({ storyID: this.props.story.id, isClosed: true });
|
||||
void this.props.setStoryClosed({
|
||||
storyID: this.props.story.id,
|
||||
isClosed: true,
|
||||
});
|
||||
};
|
||||
|
||||
public render() {
|
||||
|
||||
@@ -43,7 +43,7 @@ const AddMessageOpen: FunctionComponent<Props> = ({
|
||||
return;
|
||||
}
|
||||
|
||||
updateMutation({
|
||||
void updateMutation({
|
||||
id: storyID,
|
||||
settings: {
|
||||
messageBox: {
|
||||
@@ -58,7 +58,7 @@ const AddMessageOpen: FunctionComponent<Props> = ({
|
||||
[updateMutation, setShowSuccess]
|
||||
);
|
||||
const onRemoveClicked = useCallback(() => {
|
||||
updateMutation({
|
||||
void updateMutation({
|
||||
id: storyID,
|
||||
settings: {
|
||||
messageBox: { icon: "", content: "", enabled: false },
|
||||
|
||||
@@ -19,7 +19,7 @@ const loadConfigureContainer = () =>
|
||||
import("./ConfigureContainer" /* webpackChunkName: "configure" */).then(
|
||||
(x) => {
|
||||
// New css is loaded, take care of polyfilling those css vars for IE11.
|
||||
polyfillCSSVarsForIE11();
|
||||
void polyfillCSSVarsForIE11();
|
||||
return x;
|
||||
}
|
||||
);
|
||||
|
||||
+2
-2
@@ -36,9 +36,9 @@ const OpenOrCloseStreamContainer: FunctionComponent<Props> = ({
|
||||
if (!waiting) {
|
||||
setWaiting(true);
|
||||
if (story.isClosed) {
|
||||
openStory({ id: story.id });
|
||||
await openStory({ id: story.id });
|
||||
} else {
|
||||
closeStory({ id: story.id });
|
||||
await closeStory({ id: story.id });
|
||||
}
|
||||
setWaiting(false);
|
||||
setShowSuccess(true);
|
||||
|
||||
@@ -117,7 +117,7 @@ const ExpertSelectionContainer: FunctionComponent<Props> = ({
|
||||
|
||||
const onAddExpert = useCallback(
|
||||
(id: string) => {
|
||||
addExpertMutation({
|
||||
void addExpertMutation({
|
||||
storyID,
|
||||
userID: id,
|
||||
});
|
||||
@@ -127,7 +127,7 @@ const ExpertSelectionContainer: FunctionComponent<Props> = ({
|
||||
);
|
||||
const onRemoveExpert = useCallback(
|
||||
(id: string, username: string | null, email: string | null) => {
|
||||
removeExpertMutation({
|
||||
void removeExpertMutation({
|
||||
storyID,
|
||||
userID: id,
|
||||
});
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ const DeletionRequestCalloutContainer: FunctionComponent<Props> = ({
|
||||
|
||||
const cancelDeletionMutation = useMutation(CancelAccountDeletionMutation);
|
||||
const cancelDeletion = useCallback(() => {
|
||||
cancelDeletionMutation();
|
||||
void cancelDeletionMutation();
|
||||
}, [cancelDeletionMutation]);
|
||||
|
||||
const { locales } = useCoralContext();
|
||||
|
||||
@@ -28,7 +28,7 @@ const HistoryCommentContainer: FunctionComponent<Props> = (props) => {
|
||||
const handleGotoConversation = useCallback(
|
||||
(e: React.MouseEvent) => {
|
||||
if (props.story.id === props.comment.story.id) {
|
||||
props.setCommentID({ id: props.comment.id });
|
||||
void props.setCommentID({ id: props.comment.id });
|
||||
emitViewConversationEvent({
|
||||
from: "COMMENT_HISTORY",
|
||||
commentID: props.comment.id,
|
||||
|
||||
@@ -19,7 +19,7 @@ import { ProfileQueryLocal as Local } from "coral-stream/__generated__/ProfileQu
|
||||
const loadProfileContainer = () =>
|
||||
import("./ProfileContainer" /* webpackChunkName: "profile" */).then((x) => {
|
||||
// New css is loaded, take care of polyfilling those css vars for IE11.
|
||||
polyfillCSSVarsForIE11();
|
||||
void polyfillCSSVarsForIE11();
|
||||
return x;
|
||||
});
|
||||
// (cvle) For some reason without `setTimeout` this request will block other requests.
|
||||
|
||||
@@ -30,16 +30,16 @@ const ChangePasswordContainer: FunctionComponent<Props> = ({
|
||||
const setAuthPopupState = useMutation(SetAuthPopupStateMutation);
|
||||
const showAuthPopup = useMutation(ShowAuthPopupMutation);
|
||||
const onResetPassword = useCallback(() => {
|
||||
showAuthPopup({ view: "FORGOT_PASSWORD" });
|
||||
void showAuthPopup({ view: "FORGOT_PASSWORD" });
|
||||
}, [showAuthPopup]);
|
||||
const onFocus = useCallback(() => {
|
||||
setAuthPopupState({ focus: true });
|
||||
void setAuthPopupState({ focus: true });
|
||||
}, [setAuthPopupState]);
|
||||
const onBlur = useCallback(() => {
|
||||
setAuthPopupState({ focus: true });
|
||||
void setAuthPopupState({ focus: true });
|
||||
}, [setAuthPopupState]);
|
||||
const onClose = useCallback(() => {
|
||||
setAuthPopupState({ open: false });
|
||||
void setAuthPopupState({ open: false });
|
||||
}, [setAuthPopupState]);
|
||||
|
||||
if (
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ const DeleteAccountContainer: FunctionComponent<Props> = ({
|
||||
}, [setDeletePopoverVisible]);
|
||||
|
||||
const cancelDeletion = useCallback(() => {
|
||||
cancelAccountDeletion();
|
||||
void cancelAccountDeletion();
|
||||
}, [cancelAccountDeletion]);
|
||||
|
||||
const { locales } = useCoralContext();
|
||||
|
||||
@@ -67,7 +67,7 @@ it("validate min", async () => {
|
||||
act(() => rte.props.onChange("ab"));
|
||||
act(() => form.props.onSubmit());
|
||||
await act(async () => {
|
||||
waitForElement(() => within(form).getByText(text));
|
||||
await waitForElement(() => within(form).getByText(text));
|
||||
});
|
||||
|
||||
// Reset validation when erasing all content.
|
||||
@@ -153,10 +153,14 @@ it("update from server upon specific char count error", async () => {
|
||||
);
|
||||
|
||||
act(() => rte.props.onChange("abc"));
|
||||
waitForElement(() => within(form).getByText("7 characters remaining"));
|
||||
await waitForElement(() =>
|
||||
within(form).getByText("7 characters remaining")
|
||||
);
|
||||
|
||||
act(() => rte.props.onChange("abcdefgh"));
|
||||
waitForElement(() => within(form).getByText("2 characters remaining"));
|
||||
await waitForElement(() =>
|
||||
within(form).getByText("2 characters remaining")
|
||||
);
|
||||
|
||||
act(() => {
|
||||
form.props.onSubmit();
|
||||
|
||||
@@ -114,10 +114,10 @@ it("show remaining characters", async () => {
|
||||
const { rte, form } = await createTestRenderer();
|
||||
|
||||
act(() => rte.props.onChange("abc"));
|
||||
waitForElement(() => within(form).getByText("7 characters remaining"));
|
||||
await waitForElement(() => within(form).getByText("7 characters remaining"));
|
||||
|
||||
act(() => rte.props.onChange("abcdefghijkl"));
|
||||
waitForElement(() => within(form).getByText("-2 characters remaining"));
|
||||
await waitForElement(() => within(form).getByText("-2 characters remaining"));
|
||||
});
|
||||
|
||||
it("update from server upon specific char count error", async () => {
|
||||
@@ -157,16 +157,22 @@ it("update from server upon specific char count error", async () => {
|
||||
);
|
||||
|
||||
act(() => rte.props.onChange("abc"));
|
||||
waitForElement(() => within(form).getByText("7 characters remaining"));
|
||||
await waitForElement(() =>
|
||||
within(form).getByText("7 characters remaining")
|
||||
);
|
||||
|
||||
act(() => rte.props.onChange("abcdefgh"));
|
||||
waitForElement(() => within(form).getByText("2 characters remaining"));
|
||||
await waitForElement(() =>
|
||||
within(form).getByText("2 characters remaining")
|
||||
);
|
||||
|
||||
await act(async () => form.props.onSubmit());
|
||||
waitForElement(() => within(form).getByText("-3 characters remaining"));
|
||||
await waitForElement(() =>
|
||||
within(form).getByText("-3 characters remaining")
|
||||
);
|
||||
|
||||
// Body submit error should be displayed.
|
||||
waitForElement(() => within(form).getByText(errorCode));
|
||||
await waitForElement(() => within(form).getByText(errorCode));
|
||||
|
||||
act(() => rte.props.onChange("abcde"));
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ async function createTestRenderer(
|
||||
}
|
||||
|
||||
it("emit commentCount events", (done) => {
|
||||
createTestRenderer().then(({ context: { eventEmitter } }) => {
|
||||
void createTestRenderer().then(({ context: { eventEmitter } }) => {
|
||||
eventEmitter.on("commentCount", (args) => {
|
||||
expect(args).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
|
||||
@@ -5,7 +5,8 @@ jest.mock("react-transition-group", () => ({
|
||||
}));
|
||||
|
||||
jest.mock("react-dom", () => ({
|
||||
...jest.requireActual("react-dom"),
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
||||
...(jest.requireActual("react-dom") as any),
|
||||
createPortal: (node: any) => node,
|
||||
}));
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ import React from "react";
|
||||
import TestRenderer, { ReactTestRenderer } from "react-test-renderer";
|
||||
import sinon from "sinon";
|
||||
|
||||
import { act } from "coral-framework/testHelpers";
|
||||
|
||||
import Modal from "./Modal";
|
||||
|
||||
const createNodeMock = () => ({
|
||||
@@ -12,7 +14,7 @@ const createNodeMock = () => ({
|
||||
it("renders correctly", () => {
|
||||
expect(document.body.lastChild).toBeNull();
|
||||
let testRenderer: ReactTestRenderer;
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer = TestRenderer.create(
|
||||
<Modal>
|
||||
<div>Test</div>
|
||||
@@ -22,7 +24,7 @@ it("renders correctly", () => {
|
||||
});
|
||||
expect(testRenderer!.toJSON()).toBeNull();
|
||||
expect(document.body.lastChild).toBeNull();
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer.update(
|
||||
<Modal open>
|
||||
<div>Test</div>
|
||||
@@ -33,7 +35,7 @@ it("renders correctly", () => {
|
||||
expect(document.body.lastElementChild!.getAttribute("data-portal")).toBe(
|
||||
"modal"
|
||||
);
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer.unmount();
|
||||
});
|
||||
expect(document.body.lastChild).toBeNull();
|
||||
@@ -45,7 +47,7 @@ it("relays backdrop click events", () => {
|
||||
const onClose = sinon.stub();
|
||||
expect(document.body.lastChild).toBeNull();
|
||||
let testRenderer: ReactTestRenderer;
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer = TestRenderer.create(
|
||||
<Modal open onBackdropClick={onBackdropClick} onClose={onClose}>
|
||||
<div>Test</div>
|
||||
@@ -56,7 +58,7 @@ it("relays backdrop click events", () => {
|
||||
testRenderer!.root
|
||||
.findByProps({ "data-testid": "backdrop" })
|
||||
.props.onClick(event);
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer.unmount();
|
||||
});
|
||||
expect(onBackdropClick.called).toBe(true);
|
||||
@@ -70,7 +72,7 @@ it("relays esc events", () => {
|
||||
const onClose = sinon.stub();
|
||||
expect(document.body.lastChild).toBeNull();
|
||||
let testRenderer: ReactTestRenderer;
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer = TestRenderer.create(
|
||||
<Modal open onEscapeKeyDown={onEscapeKeyDown} onClose={onClose}>
|
||||
<div>Test</div>
|
||||
@@ -81,7 +83,7 @@ it("relays esc events", () => {
|
||||
const el = testRenderer!.root.find((i) => i.props.onKeyDown);
|
||||
el.props.onKeyDown(escEvent);
|
||||
el.props.onKeyDown(otherEvent);
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer.unmount();
|
||||
});
|
||||
expect(onEscapeKeyDown.called).toBe(true);
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
import React from "react";
|
||||
import TestRenderer, { ReactTestRenderer } from "react-test-renderer";
|
||||
|
||||
import { act } from "coral-framework/testHelpers";
|
||||
|
||||
import NoScroll from "./NoScroll";
|
||||
|
||||
it("renders correctly", () => {
|
||||
expect(document.body.className).toBe("");
|
||||
let testRenderer: ReactTestRenderer;
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer = TestRenderer.create(<NoScroll active />);
|
||||
});
|
||||
expect(document.body.className).toBe("NoScroll-noScroll");
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer.update(<NoScroll />);
|
||||
});
|
||||
expect(document.body.className).toBe("");
|
||||
@@ -19,7 +21,7 @@ it("renders correctly", () => {
|
||||
it("renders correctly with multiple instances", () => {
|
||||
expect(document.body.className).toBe("");
|
||||
let testRenderer: ReactTestRenderer;
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer = TestRenderer.create(
|
||||
<>
|
||||
<NoScroll active />
|
||||
@@ -29,7 +31,7 @@ it("renders correctly with multiple instances", () => {
|
||||
);
|
||||
});
|
||||
expect(document.body.className).toBe("NoScroll-noScroll");
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer.update(
|
||||
<>
|
||||
<NoScroll />
|
||||
@@ -39,7 +41,7 @@ it("renders correctly with multiple instances", () => {
|
||||
);
|
||||
});
|
||||
expect(document.body.className).toBe("NoScroll-noScroll");
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer.update(
|
||||
<>
|
||||
<NoScroll />
|
||||
|
||||
@@ -3,6 +3,8 @@ import React from "react";
|
||||
import TestRenderer, { ReactTestRenderer } from "react-test-renderer";
|
||||
import sinon from "sinon";
|
||||
|
||||
import { act } from "coral-framework/testHelpers";
|
||||
|
||||
import Modal from "./Modal";
|
||||
|
||||
const createNodeMock = () => ({
|
||||
@@ -12,7 +14,7 @@ const createNodeMock = () => ({
|
||||
it("renders correctly", () => {
|
||||
expect(document.body.lastChild).toBeNull();
|
||||
let testRenderer: ReactTestRenderer;
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer = TestRenderer.create(
|
||||
<Modal>
|
||||
<div>Test</div>
|
||||
@@ -22,7 +24,7 @@ it("renders correctly", () => {
|
||||
});
|
||||
expect(testRenderer!.toJSON()).toBeNull();
|
||||
expect(document.body.lastChild).toBeNull();
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer.update(
|
||||
<Modal open>
|
||||
<div>Test</div>
|
||||
@@ -33,7 +35,7 @@ it("renders correctly", () => {
|
||||
expect(document.body.lastElementChild!.getAttribute("data-portal")).toBe(
|
||||
"modal"
|
||||
);
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer.unmount();
|
||||
});
|
||||
expect(document.body.lastChild).toBeNull();
|
||||
@@ -45,7 +47,7 @@ it("relays backdrop click events", () => {
|
||||
const onClose = sinon.stub();
|
||||
expect(document.body.lastChild).toBeNull();
|
||||
let testRenderer: ReactTestRenderer;
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer = TestRenderer.create(
|
||||
<Modal open onBackdropClick={onBackdropClick} onClose={onClose}>
|
||||
<div>Test</div>
|
||||
@@ -56,7 +58,7 @@ it("relays backdrop click events", () => {
|
||||
testRenderer!.root
|
||||
.findByProps({ "data-testid": "backdrop" })
|
||||
.props.onClick(event);
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer.unmount();
|
||||
});
|
||||
expect(onBackdropClick.called).toBe(true);
|
||||
@@ -70,7 +72,7 @@ it("relays esc events", () => {
|
||||
const onClose = sinon.stub();
|
||||
expect(document.body.lastChild).toBeNull();
|
||||
let testRenderer: ReactTestRenderer;
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer = TestRenderer.create(
|
||||
<Modal open onEscapeKeyDown={onEscapeKeyDown} onClose={onClose}>
|
||||
<div>Test</div>
|
||||
@@ -81,7 +83,7 @@ it("relays esc events", () => {
|
||||
const el = testRenderer!.root.find((i) => i.props.onKeyDown);
|
||||
el.props.onKeyDown(escEvent);
|
||||
el.props.onKeyDown(otherEvent);
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer.unmount();
|
||||
});
|
||||
expect(onEscapeKeyDown.called).toBe(true);
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
import React from "react";
|
||||
import TestRenderer, { ReactTestRenderer } from "react-test-renderer";
|
||||
|
||||
import { act } from "coral-framework/testHelpers";
|
||||
|
||||
import NoScroll from "./NoScroll";
|
||||
|
||||
it("renders correctly", () => {
|
||||
expect(document.body.className).toBe("");
|
||||
let testRenderer: ReactTestRenderer;
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer = TestRenderer.create(<NoScroll active />);
|
||||
});
|
||||
expect(document.body.className).toBe("NoScroll-noScroll");
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer.update(<NoScroll />);
|
||||
});
|
||||
expect(document.body.className).toBe("");
|
||||
@@ -19,7 +21,7 @@ it("renders correctly", () => {
|
||||
it("renders correctly with multiple instances", () => {
|
||||
expect(document.body.className).toBe("");
|
||||
let testRenderer: ReactTestRenderer;
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer = TestRenderer.create(
|
||||
<>
|
||||
<NoScroll active />
|
||||
@@ -29,7 +31,7 @@ it("renders correctly with multiple instances", () => {
|
||||
);
|
||||
});
|
||||
expect(document.body.className).toBe("NoScroll-noScroll");
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer.update(
|
||||
<>
|
||||
<NoScroll />
|
||||
@@ -39,7 +41,7 @@ it("renders correctly with multiple instances", () => {
|
||||
);
|
||||
});
|
||||
expect(document.body.className).toBe("NoScroll-noScroll");
|
||||
TestRenderer.act(() => {
|
||||
act(() => {
|
||||
testRenderer.update(
|
||||
<>
|
||||
<NoScroll />
|
||||
|
||||
Reference in New Issue
Block a user