Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions test/specs/settings.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ describe('@settings - Settings', () => {
describe('General', () => {
ciIt('@settings_1 - Can switch local currency', async () => {
// switch to local currency
const fiatSymbol = await elementByIdWithin('TotalBalance-primary','MoneyFiatSymbol');
try {
await tap('TotalBalance');
await expect(await elementsById('MoneyFiatSymbol')[1]).toHaveText('$');
await expect(fiatSymbol).toHaveText('$');
} catch {
await tap('TotalBalance');
}
await expect(await elementsById('MoneyFiatSymbol')[1]).toHaveText('$');
await expect(fiatSymbol).toHaveText('$');
Comment thread
piotr-iohk marked this conversation as resolved.

// - change settings (currency to EUR) //
await tap('HeaderMenu');
Expand All @@ -52,12 +53,12 @@ describe('@settings - Settings', () => {
await eur_opt.click();
await doNavigationClose();

await expect(await elementsById('MoneyFiatSymbol')[1]).toHaveText('€');
await expect(fiatSymbol).toHaveText('€');

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fiatSymbol element was queried at the beginning of the test before any currency changes. After changing the currency to EUR, the element reference may be stale and not reflect the updated currency symbol. Re-query the element after the currency change to ensure the assertion validates the current DOM state.

Copilot uses AI. Check for mistakes.

// switch back to sats
await tap('TotalBalance');
await sleep(500);
await expect(await elementsById('MoneyFiatSymbol')[1]).toHaveText('₿');
await expect(fiatSymbol).toHaveText('₿');
Comment thread
piotr-iohk marked this conversation as resolved.

// switch to USD
await tap('HeaderMenu');
Expand All @@ -71,18 +72,18 @@ describe('@settings - Settings', () => {
});

ciIt('@settings_2 - Can switch Bitcoin Unit', async () => {
const fiatSymbol = (await elementsById('MoneyFiatSymbol'))[1];
const balance = (await elementsById('MoneyText'))[1];
const unitRow = await elementByIdWithin('UnitSettings', 'Value');

const fiatSymbol = await elementByIdWithin('TotalBalance-primary','MoneyFiatSymbol');
const balance = await elementByIdWithin('TotalBalance-primary','MoneyText');

await tap('HeaderMenu');
await tap('DrawerSettings');
await tap('GeneralSettings');

// switch to USD
await tap('UnitSettings');
await tap('USD');
await tap('NavigationBack');
const unitRow = await elementByIdWithin('UnitSettings', 'Value');
await expect(unitRow).toHaveText('USD');
await doNavigationClose();
await expect(fiatSymbol).toHaveText('$');
Expand All @@ -109,9 +110,7 @@ describe('@settings - Settings', () => {
await tap('NavigationBack');
await expect(unitRow).toHaveText('Bitcoin');
await doNavigationClose();
// https://github.com/synonymdev/bitkit-android/issues/342
// await expect(balance).toHaveText('0.00000000');
await expect(balance).toHaveText('0');
await expect(balance).toHaveText('0.00000000');
});

ciIt('@settings_3 - Can switch transaction speed', async () => {
Expand Down