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