Skip to content

Commit

Permalink
disable currencies other than usd for test
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Yunkevich committed Mar 25, 2024
1 parent 1086a79 commit 8fdf7f2
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions tests/integration/Currency.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,26 @@ describe('currency', () => {
assert.ok(cur[currency.LAST_UPDATED] > 0);
assert.ok(cur.BTC_USD > 0);

// disabled, because Mintlayer currency API doesn't currently support other fiat units
// now, setting other currency as default
await AsyncStorage.setItem(currency.PREFERRED_CURRENCY, JSON.stringify(FiatUnit.JPY));
await currency.init(true);
cur = JSON.parse(await AsyncStorage.getItem(currency.EXCHANGE_RATES));
assert.ok(cur.BTC_JPY > 0);
// await AsyncStorage.setItem(currency.PREFERRED_CURRENCY, JSON.stringify(FiatUnit.JPY));
// await currency.init(true);
// cur = JSON.parse(await AsyncStorage.getItem(currency.EXCHANGE_RATES));
// assert.ok(cur.BTC_JPY > 0);

// now setting with a proper setter
await currency.setPrefferedCurrency(FiatUnit.EUR);
await currency.init(true);
const preferred = await currency.getPreferredCurrency();
assert.strictEqual(preferred.endPointKey, 'EUR');
cur = JSON.parse(await AsyncStorage.getItem(currency.EXCHANGE_RATES));
assert.ok(cur.BTC_EUR > 0);
// await currency.setPrefferedCurrency(FiatUnit.EUR);
// await currency.init(true);
// const preferred = await currency.getPreferredCurrency();
// assert.strictEqual(preferred.endPointKey, 'EUR');
// cur = JSON.parse(await AsyncStorage.getItem(currency.EXCHANGE_RATES));
// assert.ok(cur.BTC_EUR > 0);

// test Yadio rate source
await currency.setPrefferedCurrency(FiatUnit.ARS);
await currency.init(true);
cur = JSON.parse(await AsyncStorage.getItem(currency.EXCHANGE_RATES));
assert.ok(cur.BTC_ARS > 0);
// await currency.setPrefferedCurrency(FiatUnit.ARS);
// await currency.init(true);
// cur = JSON.parse(await AsyncStorage.getItem(currency.EXCHANGE_RATES));
// assert.ok(cur.BTC_ARS > 0);

// test BitcoinduLiban rate source
// disabled, because it throws "Service Temporarily Unavailable" on circleci
Expand All @@ -42,9 +43,9 @@ describe('currency', () => {
// assert.ok(cur.BTC_LBP > 0);

// test Exir rate source
await currency.setPrefferedCurrency(FiatUnit.IRT);
await currency.init(true);
cur = JSON.parse(await AsyncStorage.getItem(currency.EXCHANGE_RATES));
assert.ok(cur.BTC_IRT > 0);
// await currency.setPrefferedCurrency(FiatUnit.IRT);
// await currency.init(true);
// cur = JSON.parse(await AsyncStorage.getItem(currency.EXCHANGE_RATES));
// assert.ok(cur.BTC_IRT > 0);
});
});

0 comments on commit 8fdf7f2

Please sign in to comment.