Skip to content

Commit b142e38

Browse files
authored
Merge pull request #46 from synonymdev/fix/zero-denomination
Update settings_2 for #342 fix + small refactor
2 parents cccafc5 + 9c93f3f commit b142e38

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

test/specs/settings.e2e.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@ describe('@settings - Settings', () => {
3434
describe('General', () => {
3535
ciIt('@settings_1 - Can switch local currency', async () => {
3636
// switch to local currency
37+
const fiatSymbol = await elementByIdWithin('TotalBalance-primary','MoneyFiatSymbol');
3738
try {
3839
await tap('TotalBalance');
39-
await expect(await elementsById('MoneyFiatSymbol')[1]).toHaveText('$');
40+
await expect(fiatSymbol).toHaveText('$');
4041
} catch {
4142
await tap('TotalBalance');
4243
}
43-
await expect(await elementsById('MoneyFiatSymbol')[1]).toHaveText('$');
44+
await expect(fiatSymbol).toHaveText('$');
4445

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

55-
await expect(await elementsById('MoneyFiatSymbol')[1]).toHaveText('€');
56+
await expect(fiatSymbol).toHaveText('€');
5657

5758
// switch back to sats
5859
await tap('TotalBalance');
5960
await sleep(500);
60-
await expect(await elementsById('MoneyFiatSymbol')[1]).toHaveText('₿');
61+
await expect(fiatSymbol).toHaveText('₿');
6162

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

7374
ciIt('@settings_2 - Can switch Bitcoin Unit', async () => {
74-
const fiatSymbol = (await elementsById('MoneyFiatSymbol'))[1];
75-
const balance = (await elementsById('MoneyText'))[1];
76-
const unitRow = await elementByIdWithin('UnitSettings', 'Value');
77-
75+
const fiatSymbol = await elementByIdWithin('TotalBalance-primary','MoneyFiatSymbol');
76+
const balance = await elementByIdWithin('TotalBalance-primary','MoneyText');
77+
7878
await tap('HeaderMenu');
7979
await tap('DrawerSettings');
8080
await tap('GeneralSettings');
81-
81+
8282
// switch to USD
8383
await tap('UnitSettings');
8484
await tap('USD');
8585
await tap('NavigationBack');
86+
const unitRow = await elementByIdWithin('UnitSettings', 'Value');
8687
await expect(unitRow).toHaveText('USD');
8788
await doNavigationClose();
8889
await expect(fiatSymbol).toHaveText('$');
@@ -109,9 +110,7 @@ describe('@settings - Settings', () => {
109110
await tap('NavigationBack');
110111
await expect(unitRow).toHaveText('Bitcoin');
111112
await doNavigationClose();
112-
// https://github.com/synonymdev/bitkit-android/issues/342
113-
// await expect(balance).toHaveText('0.00000000');
114-
await expect(balance).toHaveText('0');
113+
await expect(balance).toHaveText('0.00000000');
115114
});
116115

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

0 commit comments

Comments
 (0)