web: set user status to premium during tests

This commit is contained in:
Abdullah Atta
2022-09-29 15:36:23 +05:00
committed by Abdullah Atta
parent 745c89ef86
commit 2334987359
2 changed files with 3 additions and 1 deletions

View File

@@ -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,

View File

@@ -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;