test(e2e): restore authenticated parity fixtures
This commit is contained in:
@@ -192,6 +192,7 @@ const installFixture = async (
|
|||||||
await page.route('**/che/api/trpc/**', async (route) => {
|
await page.route('**/che/api/trpc/**', async (route) => {
|
||||||
const body = route.request().postDataJSON();
|
const body = route.request().postDataJSON();
|
||||||
const results = operationNames(route).map((operation) => {
|
const results = operationNames(route).map((operation) => {
|
||||||
|
if (operation === 'auth.status') return response({ userId: 'frontend-parity-user' });
|
||||||
if (operation === 'lobby.info') {
|
if (operation === 'lobby.info') {
|
||||||
return response({ ...fixture.game.lobby, myGeneral: general });
|
return response({ ...fixture.game.lobby, myGeneral: general });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ const installFixture = async (page: Page, options: { failBuff?: boolean } = {})
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const result = names.map((name) => {
|
const result = names.map((name) => {
|
||||||
|
if (name === 'auth.status') return response({ userId: 'frontend-parity-user' });
|
||||||
if (name === 'inherit.getStatus') return response(statusFixture);
|
if (name === 'inherit.getStatus') return response(statusFixture);
|
||||||
if (name === 'lobby.info') {
|
if (name === 'lobby.info') {
|
||||||
return response({
|
return response({
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ const installFixture = async (
|
|||||||
const operations = operationNames(route);
|
const operations = operationNames(route);
|
||||||
const requestBody = route.request().postDataJSON();
|
const requestBody = route.request().postDataJSON();
|
||||||
const results = operations.map((operation) => {
|
const results = operations.map((operation) => {
|
||||||
|
if (operation === 'auth.status') return response({ userId: 'frontend-parity-user' });
|
||||||
if (operation === 'lobby.info') {
|
if (operation === 'lobby.info') {
|
||||||
return response({ ...fixture.game.lobby, myGeneral: general });
|
return response({ ...fixture.game.lobby, myGeneral: general });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ const installMainFixture = async (
|
|||||||
: response(liveStatus);
|
: response(liveStatus);
|
||||||
}
|
}
|
||||||
if (operation === 'general.getRecentRecords') return response({ global: [], general: [], history: [] });
|
if (operation === 'general.getRecentRecords') return response({ global: [], general: [], history: [] });
|
||||||
|
if (operation === 'auth.status') return response({ userId: 'frontend-parity-user' });
|
||||||
if (operation === 'lobby.info') {
|
if (operation === 'lobby.info') {
|
||||||
return response({
|
return response({
|
||||||
year: 190,
|
year: 190,
|
||||||
|
|||||||
@@ -242,6 +242,7 @@ test('renders all three real database record buckets with legacy computed geomet
|
|||||||
? trpcError(operation, '동향 정보를 불러오지 못했습니다.')
|
? trpcError(operation, '동향 정보를 불러오지 못했습니다.')
|
||||||
: trpcResponse(liveRecords);
|
: trpcResponse(liveRecords);
|
||||||
}
|
}
|
||||||
|
if (operation === 'auth.status') return trpcResponse({ userId: 'frontend-parity-user' });
|
||||||
if (operation === 'lobby.info') {
|
if (operation === 'lobby.info') {
|
||||||
return trpcResponse({
|
return trpcResponse({
|
||||||
year: 190,
|
year: 190,
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ const installGatewayMapFixture = async (page: Page) => {
|
|||||||
});
|
});
|
||||||
await page.route('**/che/api/trpc/**', async (route) => {
|
await page.route('**/che/api/trpc/**', async (route) => {
|
||||||
const results = operationNames(route).map((operation) => {
|
const results = operationNames(route).map((operation) => {
|
||||||
|
if (operation === 'auth.status') return response({ userId: 'frontend-parity-user' });
|
||||||
if (operation === 'lobby.info') return response(fixture.game.lobby);
|
if (operation === 'lobby.info') return response(fixture.game.lobby);
|
||||||
if (operation === 'public.getMapLayout') return response(fixture.game.mapLayout);
|
if (operation === 'public.getMapLayout') return response(fixture.game.mapLayout);
|
||||||
if (operation === 'public.getCachedMap') {
|
if (operation === 'public.getCachedMap') {
|
||||||
@@ -162,6 +163,7 @@ const installMainFixture = async (page: Page, failRecords = false) => {
|
|||||||
);
|
);
|
||||||
await page.route('**/che/api/trpc/**', async (route) => {
|
await page.route('**/che/api/trpc/**', async (route) => {
|
||||||
const results = operationNames(route).map((operation) => {
|
const results = operationNames(route).map((operation) => {
|
||||||
|
if (operation === 'auth.status') return response({ userId: 'frontend-parity-user' });
|
||||||
if (operation === 'lobby.info') {
|
if (operation === 'lobby.info') {
|
||||||
return response({ ...fixture.game.lobby, myGeneral: fixture.game.session.general });
|
return response({ ...fixture.game.lobby, myGeneral: fixture.game.session.general });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ const installBettingFixture = async (page: Page) => {
|
|||||||
let failBet = true;
|
let failBet = true;
|
||||||
await page.route('**/che/api/trpc/**', async (route) => {
|
await page.route('**/che/api/trpc/**', async (route) => {
|
||||||
const results = operationNames(route).map((operation) => {
|
const results = operationNames(route).map((operation) => {
|
||||||
|
if (operation === 'auth.status') return response({ userId: 'frontend-parity-user' });
|
||||||
if (operation === 'lobby.info') {
|
if (operation === 'lobby.info') {
|
||||||
return response({ myGeneral: { id: 1, name: '테스트 장수' } });
|
return response({ myGeneral: { id: 1, name: '테스트 장수' } });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user