fix(suite-native): check correct urls for universal links

This commit is contained in:
vytick
2026-02-19 21:57:40 +04:00
parent 01d301595c
commit 742ec78f1c
4 changed files with 8 additions and 8 deletions

View File

@@ -251,7 +251,7 @@ export default ({ config }: ConfigContext): ExpoConfig => {
{
scheme: 'https',
host: 'trezor.io',
pathPattern: '/suite/deeplink/.*',
pathPattern: '/suite/deeplinks/.*',
},
]
: [

View File

@@ -1,6 +1,6 @@
import { isProduction } from '@suite-native/config';
const TRADING_URL_BASE_PRODUCTION = 'https://trezor.io/suite/deeplink/trade';
const TRADING_URL_BASE_PRODUCTION = 'https://trezor.io/suite/deeplinks/trade';
const TRADING_URL_BASE_DEV = 'trezorsuite://trading';
// we don't want to expose custom scheme in production,

View File

@@ -252,7 +252,7 @@ ${' '.repeat(16)}
it('should use production back URL in applyHtmlTemplate', () => {
const html = applyHtmlTemplate('CONTENT_TO_EMBED');
expect(html).toContain('href="https://trezor.io/suite/deeplink/trade/back"');
expect(html).toContain('href="https://trezor.io/suite/deeplinks/trade/back"');
});
it('should return correct url format with production base', () => {
@@ -263,7 +263,7 @@ ${' '.repeat(16)}
orderId: '1234',
}),
).toBe(
'https://trezor.io/suite/deeplink/trade?action=quote&tradeType=buy&orderId=1234',
'https://trezor.io/suite/deeplinks/trade?action=quote&tradeType=buy&orderId=1234',
);
});
});

View File

@@ -67,19 +67,19 @@ describe('utils', () => {
});
it('should use production URL base', () => {
expect(TRADING_URL_BASE).toBe('https://trezor.io/suite/deeplink/trade');
expect(TRADING_URL_DEFAULT_BACK).toBe('https://trezor.io/suite/deeplink/trade/back');
expect(TRADING_URL_BASE).toBe('https://trezor.io/suite/deeplinks/trade');
expect(TRADING_URL_DEFAULT_BACK).toBe('https://trezor.io/suite/deeplinks/trade/back');
});
it('should return true when URL contains production base', () => {
const url =
'https://trezor.io/suite/deeplink/trade?action=trade&tradeType=buy&orderId=123';
'https://trezor.io/suite/deeplinks/trade?action=trade&tradeType=buy&orderId=123';
expect(doesUrlContainCloseCallbackUrl(url, TRADING_URL_BASE)).toBe(true);
});
it('should return true when URL contains production default back', () => {
const url =
'https://trezor.io/suite/deeplink/trade/back?action=trade&tradeType=buy&orderId=123';
'https://trezor.io/suite/deeplinks/trade/back?action=trade&tradeType=buy&orderId=123';
expect(doesUrlContainCloseCallbackUrl(url)).toBe(true);
});