Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: set user status to premium during tests

Abdullah Atta23349873592c
diff --git a/apps/web/.env-cmdrc.js b/apps/web/.env-cmdrc.js
index 5af167869..a25d31c7c 100644
--- a/apps/web/.env-cmdrc.js
+++ b/apps/web/.env-cmdrc.js
@@ -18,7 +18,7 @@ module.exports = {
},
all: {
UV_THREADPOOL_SIZE: IS_CI ? NUM_CPUS : 2,
- GENERATE_SOURCEMAP: process.env.NODE_ENV !== "production",
+ GENERATE_SOURCEMAP: process.env.NODE_ENV === "development",
INLINE_RUNTIME_CHUNK: false,
DISABLE_ESLINT_PLUGIN: true,
REACT_APP_GIT_HASH: gitHash,
diff --git a/apps/web/src/hooks/use-is-user-premium.js b/apps/web/src/hooks/use-is-user-premium.js
index 4b56fd691..03b2af58e 100644
--- a/apps/web/src/hooks/use-is-user-premium.js
+++ b/apps/web/src/hooks/use-is-user-premium.js
@@ -22,6 +22,7 @@ import {
useStore as useUserStore,
store as userstore
} from "../stores/user-store";
+import { isTesting } from "../utils/platform";
export function useIsUserPremium() {
const user = useUserStore((store) => store.user);
@@ -29,6 +30,7 @@ export function useIsUserPremium() {
}
export function isUserPremium(user) {
+ if (isTesting()) return true;
if (!user) user = userstore.get().user;
const subStatus = user?.subscription?.type;