[Tests] Fixes after sessions rework
This commit is contained in:
parent
619469078e
commit
206299fd51
@ -22,7 +22,6 @@ import {
|
||||
clearStoredSession,
|
||||
importLegacySession,
|
||||
clearLegacySessions,
|
||||
importTestSession,
|
||||
} from '../../../util/sessions';
|
||||
|
||||
addReducer('initApi', (global: GlobalState, actions) => {
|
||||
@ -30,8 +29,6 @@ addReducer('initApi', (global: GlobalState, actions) => {
|
||||
if (!IS_TEST) {
|
||||
await importLegacySession();
|
||||
void clearLegacySessions();
|
||||
} else {
|
||||
importTestSession();
|
||||
}
|
||||
|
||||
void initApi(actions.apiUpdate, {
|
||||
|
||||
@ -121,8 +121,8 @@ export async function clearLegacySessions() {
|
||||
export function importTestSession() {
|
||||
const sessionJson = process.env.TEST_SESSION!;
|
||||
try {
|
||||
const sessionData = JSON.parse(sessionJson) as ApiSessionData;
|
||||
storeSession(sessionData);
|
||||
const sessionData = JSON.parse(sessionJson) as ApiSessionData & { userId: number };
|
||||
storeSession(sessionData, sessionData.userId);
|
||||
} catch (err) {
|
||||
if (DEBUG) {
|
||||
// eslint-disable-next-line no-console
|
||||
|
||||
@ -108,6 +108,7 @@ module.exports = (env = {}, argv = {}) => {
|
||||
APP_ENV: 'production',
|
||||
TELEGRAM_T_API_ID: '',
|
||||
TELEGRAM_T_API_HASH: '',
|
||||
TEST_SESSION: '',
|
||||
}),
|
||||
...(argv.mode === 'production' ? [
|
||||
new BundleAnalyzerPlugin({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user