mirror of
https://github.com/zhigang1992/xverse-web-extension.git
synced 2026-04-30 05:35:53 +08:00
Adjust after merge
This commit is contained in:
@@ -118,7 +118,7 @@ export default function TokenImage({
|
||||
if (imageError) {
|
||||
return (
|
||||
<TickerIconContainer size={size} round={round}>
|
||||
<TickerIconText>{ticker.substring(0, 4)}</TickerIconText>
|
||||
<TickerIconText data-testid="token-image">{ticker.substring(0, 4)}</TickerIconText>
|
||||
</TickerIconContainer>
|
||||
);
|
||||
}
|
||||
@@ -156,14 +156,14 @@ export default function TokenImage({
|
||||
if (fungibleToken.runeSymbol) {
|
||||
return (
|
||||
<TickerIconContainer size={size} round={round}>
|
||||
<TickerIconText>{fungibleToken.runeSymbol}</TickerIconText>
|
||||
<TickerIconText data-testid="token-image">{fungibleToken.runeSymbol}</TickerIconText>
|
||||
</TickerIconContainer>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<TickerIconContainer size={size} round={round}>
|
||||
<TickerIconText>{ticker.substring(0, 4)}</TickerIconText>
|
||||
<TickerIconText data-testid="token-image">{ticker.substring(0, 4)}</TickerIconText>
|
||||
</TickerIconContainer>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -169,7 +169,11 @@ export default function Brc20Tile(props: Brc20TileProps) {
|
||||
isGalleryOpen={isGalleryOpen}
|
||||
isSmallImage={isSmallImage}
|
||||
>
|
||||
<TickerIconText enlargeTicker={withoutTitles} isGalleryOpen={isGalleryOpen}>
|
||||
<TickerIconText
|
||||
data-testid="token-image"
|
||||
enlargeTicker={withoutTitles}
|
||||
isGalleryOpen={isGalleryOpen}
|
||||
>
|
||||
{ticker}
|
||||
</TickerIconText>
|
||||
</TickerIconContainer>
|
||||
|
||||
@@ -208,6 +208,7 @@ function OrdinalImage({
|
||||
const renderImage = (tag: string, src?: string) => (
|
||||
<ImageContainer>
|
||||
<StyledImage
|
||||
data-testid="token-image"
|
||||
width="100%"
|
||||
height="100%"
|
||||
placeholder={
|
||||
@@ -280,7 +281,7 @@ function OrdinalImage({
|
||||
|
||||
if (contentType.includes('html')) {
|
||||
return (
|
||||
<ImageContainer inNftDetail={inNftDetail}>
|
||||
<ImageContainer data-testid="token-image" inNftDetail={inNftDetail}>
|
||||
<FillImg
|
||||
src={`${XVERSE_ORDIVIEW_URL(network.type)}/thumbnail/${ordinal.id}`}
|
||||
alt="/html/"
|
||||
@@ -297,7 +298,7 @@ function OrdinalImage({
|
||||
|
||||
if (showContentTypeThumbnail) {
|
||||
return (
|
||||
<ImageContainer>
|
||||
<ImageContainer data-testid="token-image">
|
||||
<ContentTypeThumbnailContainer>
|
||||
<TextT width="50%" height="50%" color={Theme.colors.elevation0} />
|
||||
</ContentTypeThumbnailContainer>
|
||||
@@ -326,7 +327,7 @@ function OrdinalImage({
|
||||
}
|
||||
|
||||
return (
|
||||
<ImageContainer>
|
||||
<ImageContainer data-testid="token-image">
|
||||
<img src={placeholderIcon ?? PlaceholderImage} alt="ordinal" />
|
||||
</ImageContainer>
|
||||
);
|
||||
|
||||
@@ -630,8 +630,6 @@ export default class Wallet {
|
||||
}
|
||||
|
||||
async checkVisualsSendInscriptionsPage2(ordinalAddress, ordinalNumber, collection) {
|
||||
await expect(this.confirmTotalAmount).toBeVisible();
|
||||
await expect(this.confirmCurrencyAmount).toBeVisible();
|
||||
await expect(this.buttonExpand).toBeVisible();
|
||||
await expect(this.buttonCancel).toBeEnabled();
|
||||
await expect(this.buttonConfirm).toBeEnabled();
|
||||
@@ -711,16 +709,28 @@ export default class Wallet {
|
||||
editableFees?: boolean,
|
||||
sendAddress?: string,
|
||||
receiverAddress?: string,
|
||||
totalAmountShown: boolean = true,
|
||||
tokenImageShown: boolean = true,
|
||||
) {
|
||||
await expect(this.page.url()).toContain(url);
|
||||
await expect(this.confirmTotalAmount).toBeVisible();
|
||||
await expect(this.confirmCurrencyAmount).toBeVisible();
|
||||
await expect(this.buttonExpand).toBeVisible();
|
||||
await expect(this.buttonCancel).toBeEnabled();
|
||||
await expect(this.buttonConfirm).toBeEnabled();
|
||||
|
||||
await expect(this.feeAmount).toBeVisible();
|
||||
await expect(this.imageToken.first()).toBeVisible();
|
||||
|
||||
// Not all TX Screens show a total amount
|
||||
if (totalAmountShown) {
|
||||
await expect(this.confirmTotalAmount).toBeVisible();
|
||||
await expect(this.confirmCurrencyAmount).toBeVisible();
|
||||
}
|
||||
|
||||
if (tokenImageShown) {
|
||||
await expect(this.imageToken.first()).toBeVisible();
|
||||
}
|
||||
|
||||
if (editableFees) {
|
||||
await expect(this.buttonEditFee).toBeVisible();
|
||||
}
|
||||
|
||||
await this.buttonExpand.click();
|
||||
await expect(this.sendAddress.first()).toBeVisible();
|
||||
@@ -728,10 +738,6 @@ export default class Wallet {
|
||||
await expect(this.confirmAmount.first()).toBeVisible();
|
||||
await expect(this.confirmBalance.first()).toBeVisible();
|
||||
|
||||
if (editableFees) {
|
||||
await expect(this.buttonEditFee).toBeVisible();
|
||||
}
|
||||
|
||||
// Execute these checks only if sendAddress is provided
|
||||
if (sendAddress) {
|
||||
await expect(await this.sendAddress.first().innerText()).toContain(sendAddress.slice(-4));
|
||||
|
||||
@@ -9,7 +9,7 @@ test.describe('Swap Flow ME', () => {
|
||||
});
|
||||
|
||||
const marketplace = 'Magic Eden';
|
||||
const token = 'MONEY';
|
||||
const token = 'THE•MONEY•BEES';
|
||||
|
||||
test('Swap token via ME with standard fee mainnet #localexecution', async ({
|
||||
page,
|
||||
@@ -43,7 +43,8 @@ test.describe('Swap Flow ME', () => {
|
||||
// Had problems with loading of all tokens so I check that a 'DOG' is loaded
|
||||
await expect(wallet.labelTokenSubtitle.getByText('DOG').first()).toBeVisible();
|
||||
await expect(await wallet.divTokenRow.count()).toBeGreaterThan(0);
|
||||
await wallet.divTokenRow.filter({ hasText: token }).click();
|
||||
await wallet.inputField.fill(token);
|
||||
await wallet.divTokenRow.filter({ hasText: token }).first().click();
|
||||
await expect(wallet.nameToken.last()).not.toContainText('Select asset');
|
||||
await expect(wallet.imageToken.last()).toBeVisible();
|
||||
await expect(wallet.buttonGetQuotes).toBeDisabled();
|
||||
|
||||
@@ -9,7 +9,7 @@ test.describe('Swap Flow ME', () => {
|
||||
});
|
||||
|
||||
const marketplace = 'Magic Eden';
|
||||
const token = 'MONEY';
|
||||
const token = 'THE•MONEY•BEES';
|
||||
|
||||
test('Cancel swap token via ME', async ({ page, extensionId }) => {
|
||||
// Restore wallet
|
||||
@@ -43,7 +43,8 @@ test.describe('Swap Flow ME', () => {
|
||||
// Had problems with loading of all tokens so I check that a 'DOG' is loaded
|
||||
await expect(wallet.labelTokenSubtitle.getByText('DOG').first()).toBeVisible();
|
||||
await expect(await wallet.divTokenRow.count()).toBeGreaterThan(0);
|
||||
await wallet.divTokenRow.filter({ hasText: token }).click();
|
||||
await wallet.inputField.fill(token);
|
||||
await wallet.divTokenRow.filter({ hasText: token }).first().click();
|
||||
await expect(wallet.nameToken.last()).not.toContainText('Select asset');
|
||||
await expect(wallet.imageToken.last()).toBeVisible();
|
||||
await expect(wallet.buttonGetQuotes).toBeDisabled();
|
||||
|
||||
@@ -63,6 +63,8 @@ test.describe('Collectibles Tab - Rare sats', () => {
|
||||
false,
|
||||
addressOrdinals,
|
||||
addressOrdinals,
|
||||
false,
|
||||
false,
|
||||
);
|
||||
|
||||
// Cancel the transaction
|
||||
@@ -112,6 +114,8 @@ test.describe('Collectibles Tab - Rare sats', () => {
|
||||
false,
|
||||
addressOrdinals,
|
||||
addressOrdinals,
|
||||
false,
|
||||
false,
|
||||
);
|
||||
|
||||
await wallet.confirmSendTransaction();
|
||||
|
||||
@@ -53,7 +53,7 @@ test.describe('Transaction BTC', () => {
|
||||
await expect(initialBTCBalance).toEqual(displayBalanceNumerical);
|
||||
});
|
||||
|
||||
test('Send BTC - Cancel transaction testnet', async ({ page, extensionId }) => {
|
||||
test('Cancel BTC transaction testnet', async ({ page, extensionId }) => {
|
||||
// Restore wallet and setup Testnet network
|
||||
const wallet = new Wallet(page);
|
||||
await wallet.setupTest(extensionId, 'SEED_WORDS1', true);
|
||||
@@ -114,7 +114,7 @@ test.describe('Transaction BTC', () => {
|
||||
await expect(initialBTCBalance).toEqual(balanceAfterCancel);
|
||||
});
|
||||
|
||||
test('Send BTC - confirm transaction testnet #localexecution', async ({ page, extensionId }) => {
|
||||
test('Confirm BTC transaction testnet #localexecution', async ({ page, extensionId }) => {
|
||||
// Restore wallet and setup Testnet network
|
||||
const wallet = new Wallet(page);
|
||||
await wallet.setupTest(extensionId, 'SEED_WORDS1', true);
|
||||
|
||||
Reference in New Issue
Block a user