Commit 7f9e4547 authored by tom's avatar tom

fix tests

parent cd8305d1
...@@ -55,9 +55,6 @@ function getAssetFileExtension(value: string) { ...@@ -55,9 +55,6 @@ function getAssetFileExtension(value: string) {
const url = new URL(value); const url = new URL(value);
return url.pathname.match(regexp.FILE_EXTENSION)?.[1]; return url.pathname.match(regexp.FILE_EXTENSION)?.[1];
} catch (error) { } catch (error) {
try { return parseEnvJson(value) ? 'json' : undefined;
parseEnvJson(value);
return 'json';
} catch (error) {}
} }
} }
...@@ -8,8 +8,8 @@ import { test, expect, devices } from 'playwright/lib'; ...@@ -8,8 +8,8 @@ import { test, expect, devices } from 'playwright/lib';
import Marketplace from './Marketplace'; import Marketplace from './Marketplace';
const MARKETPLACE_CONFIG_URL = 'http://localhost/marketplace-config.json'; const MARKETPLACE_CONFIG_URL = 'http://localhost:4000/marketplace-config.json';
const MARKETPLACE_SECURITY_REPORTS_URL = 'https://marketplace-security-reports.json'; const MARKETPLACE_SECURITY_REPORTS_URL = 'https://localhost:4000/marketplace-security-reports.json';
test.beforeEach(async({ mockConfigResponse, mockEnvs, mockAssetResponse, page }) => { test.beforeEach(async({ mockConfigResponse, mockEnvs, mockAssetResponse, page }) => {
await mockEnvs([ await mockEnvs([
......
...@@ -17,8 +17,8 @@ const hooksConfig = { ...@@ -17,8 +17,8 @@ const hooksConfig = {
}, },
}; };
const MARKETPLACE_CONFIG_URL = 'https://marketplace-config.json'; const MARKETPLACE_CONFIG_URL = 'http://localhost:4000/marketplace-config.json';
const MARKETPLACE_SECURITY_REPORTS_URL = 'https://marketplace-security-reports.json'; const MARKETPLACE_SECURITY_REPORTS_URL = 'http://localhost:4000/marketplace-security-reports.json';
const testFn: Parameters<typeof test>[1] = async({ render, mockConfigResponse, mockAssetResponse, mockEnvs, mockRpcResponse, page }) => { const testFn: Parameters<typeof test>[1] = async({ render, mockConfigResponse, mockAssetResponse, mockEnvs, mockRpcResponse, page }) => {
await mockEnvs([ await mockEnvs([
......
...@@ -152,7 +152,7 @@ test('search by user op hash +@mobile', async({ render, mockApiResponse, mockEnv ...@@ -152,7 +152,7 @@ test('search by user op hash +@mobile', async({ render, mockApiResponse, mockEnv
test.describe('with apps', () => { test.describe('with apps', () => {
test('default view +@mobile', async({ render, mockApiResponse, mockConfigResponse, mockAssetResponse, mockEnvs }) => { test('default view +@mobile', async({ render, mockApiResponse, mockConfigResponse, mockAssetResponse, mockEnvs }) => {
const MARKETPLACE_CONFIG_URL = 'https://marketplace-config.json'; const MARKETPLACE_CONFIG_URL = 'https://localhost:4000/marketplace-config.json';
const hooksConfig = { const hooksConfig = {
router: { router: {
query: { q: 'o' }, query: { q: 'o' },
......
...@@ -196,7 +196,7 @@ test('recent keywords suggest +@mobile', async({ render, page }, { project }) => ...@@ -196,7 +196,7 @@ test('recent keywords suggest +@mobile', async({ render, page }, { project }) =>
}); });
test.describe('with apps', () => { test.describe('with apps', () => {
const MARKETPLACE_CONFIG_URL = 'https://marketplace-config.json'; const MARKETPLACE_CONFIG_URL = 'http://localhost:4000/marketplace-config.json';
test('default view +@mobile', async({ render, page, mockApiResponse, mockConfigResponse, mockAssetResponse, mockEnvs }) => { test('default view +@mobile', async({ render, page, mockApiResponse, mockConfigResponse, mockAssetResponse, mockEnvs }) => {
await mockEnvs([ await mockEnvs([
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment