Skip to content

Commit

Permalink
feat(ui): update design
Browse files Browse the repository at this point in the history
  • Loading branch information
pwltr committed Apr 20, 2024
1 parent 7fcd227 commit 4f8244c
Show file tree
Hide file tree
Showing 388 changed files with 5,791 additions and 6,507 deletions.
16 changes: 13 additions & 3 deletions __tests__/todos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ import {
slashtagsProfileTodo,
transferPendingTodo,
transferClosingChannelTodo,
supportTodo,
inviteTodo,
// fastpayTodo,
// discountTodo,
} from '../src/store/shapes/todos';
import { createNewWallet } from '../src/utils/startup';
import { EAvailableNetwork } from '../src/utils/networks';
Expand All @@ -41,8 +45,12 @@ describe('Todos selector', () => {
backupSeedPhraseTodo,
lightningTodo,
pinTodo,
slashtagsProfileTodo,
buyBitcoinTodo,
supportTodo,
inviteTodo,
// fastpayTodo,
slashtagsProfileTodo,
// discountTodo,
]);
});

Expand Down Expand Up @@ -91,9 +99,11 @@ describe('Todos selector', () => {
backupSeedPhrase: +new Date(),
btFailed: +new Date(),
buyBitcoin: +new Date(),
invite: +new Date(),
lightning: +new Date(),
pin: +new Date(),
slashtagsProfile: +new Date(),
support: +new Date(),
};

assert.deepEqual(todosFullSelector(state), []);
Expand Down Expand Up @@ -129,7 +139,7 @@ describe('Todos selector', () => {
);
});

it('should return transferPendingTodo for addtional pending transfers to spending', () => {
it('should return lightningSettingUpTodo for addtional pending transfers to spending', () => {
const state = cloneDeep(s);
const channel1 = {
channel_id: 'channel1',
Expand All @@ -145,7 +155,7 @@ describe('Todos selector', () => {
orderId: 'order1',
});
expect(todosFullSelector(state)).toEqual(
expect.arrayContaining([{ ...transferPendingTodo, duration: 10 }]),
expect.arrayContaining([lightningSettingUpTodo]),
);
});

Expand Down
1 change: 0 additions & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module.exports = {
[
'accounts',
'activity',
'assets',
'backup',
'boost',
'contacts',
Expand Down
13 changes: 6 additions & 7 deletions e2e/backup.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ d('Backup', () => {
}
// recieve bitcoin
await element(by.id('Receive')).tap();
await element(by.id('UnderstoodButton')).tap();
await sleep(1000); // animation
// get address from qrcode
let { label: wAddress } = await element(by.id('QRCode')).getAttributes();
Expand All @@ -75,7 +74,7 @@ d('Backup', () => {

// set tag to new tx
const tag = 'testtag';
await element(by.id('BitcoinAsset')).tap();
await element(by.id('ActivitySavings')).tap();
await element(by.id('Activity-1')).tap();
await element(by.id('ActivityTag')).tap();
await element(by.id('TagInput')).replaceText(tag);
Expand Down Expand Up @@ -108,7 +107,7 @@ d('Backup', () => {
}

await sleep(1000); // animation
await element(by.id('AssetsTitle')).swipe('up');
await element(by.id('TransferButton')).swipe('up');

// add headlines widget
await element(by.id('WidgetsAdd')).tap();
Expand Down Expand Up @@ -156,7 +155,7 @@ d('Backup', () => {
await waitFor(element(by.id('SkipIntro'))).toBeVisible();
await element(by.id('SkipIntro')).tap();
await element(by.id('RestoreWallet')).tap();
await element(by.id('MultipleButton')).tap();
await element(by.id('MultipleDevices-button')).tap();
await element(by.id('Word-0')).replaceText(seed);
await element(by.id('WordIndex-4')).swipe('up');
await element(by.id('RestoreButton')).tap();
Expand All @@ -166,11 +165,11 @@ d('Backup', () => {
.withTimeout(300000); // 5 min
await element(by.id('GetStartedButton')).tap();

// wait for AssetsTitle to appear and be accessible
// wait for SuggestionsLabel to appear and be accessible
for (let i = 0; i < 60; i++) {
await sleep(1000);
try {
await element(by.id('AssetsTitle')).tap();
await element(by.id('SuggestionsLabel')).tap();
break;
} catch (e) {}
}
Expand All @@ -181,7 +180,7 @@ d('Backup', () => {
).toHaveText('£');

// check metadata
await element(by.id('BitcoinAsset')).tap();
await element(by.id('ActivitySavings')).tap();
await element(by.id('Activity-1')).tap();
await expect(
element(by.id(`Tag-${tag}`).withAncestor(by.id('ActivityTags'))),
Expand Down
7 changes: 3 additions & 4 deletions e2e/channels.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ d('LN Channel Onboarding', () => {

// receive BTC
await element(by.id('Receive')).tap();
await element(by.id('UnderstoodButton')).tap();
// get address from qrcode
let { label: wAddress } = await element(by.id('QRCode')).getAttributes();
wAddress = wAddress.replace('bitcoin:', '');
Expand All @@ -83,7 +82,8 @@ d('LN Channel Onboarding', () => {
await element(by.id('NewTxPrompt')).swipe('down'); // close Receive screen

await element(by.id('Suggestion-lightning')).tap();
await element(by.id('QuickSetupButton')).tap();
await element(by.id('LnIntroduction-button')).tap();
await element(by.id('FundTransfer')).tap();
// set spending balance to zero
await element(by.id('SliderHandle')).swipe('left');
const button = element(by.id('QuickSetupContinue'));
Expand Down Expand Up @@ -140,9 +140,8 @@ d('LN Channel Onboarding', () => {
await waitFor(element(by.id('Suggestion-lightningSettingUp')))
.toBeVisible()
.withTimeout(10000);
await element(by.id('BitcoinAsset')).tap();
await element(by.id('TransferButton')).tap();
await element(by.id('CustomSetupButton')).tap();
await element(by.id('QuickSetupAdvanced')).tap();

// NumberPad
await element(by.id('CustomSetupCustomAmount')).tap();
Expand Down
12 changes: 6 additions & 6 deletions e2e/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,20 @@ export const completeOnboarding = async () => {
await element(by.id('NewWallet')).tap();

// wait for wallet to be created
await waitFor(element(by.id('ToGetStartedClose'))).toBeVisible();
await waitFor(element(by.id('WalletOnboardingClose'))).toBeVisible();
await sleep(1000); // take app some time to load

// try for 3min before fail
for (let i = 0; i < 180; i++) {
await sleep(1000);
try {
await element(by.id('ToGetStartedClose')).tap();
await element(by.id('WalletOnboardingClose')).tap();
await sleep(3000); // wait for redux-persist to save state
return;
} catch (e) {}
}

throw new Error('Tapping "ToGetStartedClose" timeout');
throw new Error('Tapping "WalletOnboardingClose" timeout');
};

export const launchAndWait = async () => {
Expand All @@ -97,13 +97,13 @@ export const launchAndWait = async () => {
permissions: { faceid: 'YES', camera: 'YES' },
});

// wait for AssetsTitle to appear and be accessible
await waitFor(element(by.id('AssetsTitle')))
// wait for SuggestionsLabel to appear and be accessible
await waitFor(element(by.id('SuggestionsLabel')))
.toBeVisible()
.withTimeout(300000); // 5 min
for (let i = 0; i < 60; i++) {
try {
await element(by.id('AssetsTitle')).tap();
await element(by.id('SuggestionsLabel')).tap();
await sleep(1000);
break;
} catch (e) {
Expand Down
13 changes: 5 additions & 8 deletions e2e/lightning.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ d('Lightning', () => {

// send funds to LDK, 0 invoice
await element(by.id('Receive')).tap();
try {
await element(by.id('UnderstoodButton')).tap();
} catch (e) {}
let { label: invoice1 } = await element(by.id('QRCode')).getAttributes();
invoice1 = invoice1.replaceAll(/bitcoin.*=/gi, '').toLowerCase();
await lnd.sendPaymentSync({ paymentRequest: invoice1, amt: 50000 });
Expand Down Expand Up @@ -253,7 +250,7 @@ d('Lightning', () => {
.withTimeout(10000);

// check tx history
await element(by.id('AssetsTitle')).swipe('up');
await element(by.id('TransferButton')).swipe('up');
await expect(
element(by.text('1 000').withAncestor(by.id('ActivityShort-1'))),
).toBeVisible();
Expand Down Expand Up @@ -360,7 +357,7 @@ d('Lightning', () => {
await waitFor(element(by.id('SkipIntro'))).toBeVisible();
await element(by.id('SkipIntro')).tap();
await element(by.id('RestoreWallet')).tap();
await element(by.id('MultipleButton')).tap();
await element(by.id('MultipleDevices-button')).tap();
await element(by.id('Word-0')).replaceText(seed);
await element(by.id('WordIndex-4')).swipe('up');
await element(by.id('RestoreButton')).tap();
Expand All @@ -370,11 +367,11 @@ d('Lightning', () => {
.withTimeout(300000); // 5 min
await element(by.id('GetStartedButton')).tap();

// wait for AssetsTitle to appear and be accessible
// wait for SuggestionsLabel to appear and be accessible
for (let i = 0; i < 60; i++) {
await sleep(1000);
try {
await element(by.id('AssetsTitle')).tap();
await element(by.id('SuggestionsLabel')).tap();
break;
} catch (e) {}
}
Expand All @@ -387,7 +384,7 @@ d('Lightning', () => {
.withTimeout(10000);

// check tx history
await element(by.id('AssetsTitle')).swipe('up');
await element(by.id('TransferButton')).swipe('up');
await expect(
element(by.text('111').withAncestor(by.id('ActivityShort-2'))),
).toBeVisible();
Expand Down
5 changes: 0 additions & 5 deletions e2e/numberpad.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
markComplete,
completeOnboarding,
launchAndWait,
isVisible,
} from './helpers';

const d = checkComplete(['numberpad-modern', 'numberpad-classic'])
Expand Down Expand Up @@ -39,7 +38,6 @@ d('NumberPad', () => {
}

await element(by.id('Receive')).tap();
await element(by.id('UnderstoodButton')).tap();
await element(by.id('SpecifyInvoiceButton')).tap();
await element(by.id('ReceiveNumberPadTextField')).tap();

Expand Down Expand Up @@ -94,9 +92,6 @@ d('NumberPad', () => {
await element(by.id('NavigationClose')).tap();

await element(by.id('Receive')).tap();
if (await isVisible('UnderstoodButton')) {
await element(by.id('UnderstoodButton')).tap();
}
await element(by.id('SpecifyInvoiceButton')).tap();
await element(by.id('ReceiveNumberPadTextField')).tap();

Expand Down
19 changes: 7 additions & 12 deletions e2e/onboarding.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ d('Onboarding', () => {
await waitFor(element(by.id('Check1'))).toBeVisible();
await element(by.id('Check1')).tap();
await element(by.id('Check2')).tap();
// await element(by.id('TOS')).scrollTo('bottom'); // taking too long
await element(by.id('Continue')).tap();
await element(by.id('GetStarted')).tap();
await element(by.id('Slide0')).swipe('left');
await element(by.id('Slide1')).swipe('left');
await element(by.id('Slide2')).swipe('left');
await element(by.id('Slide3')).swipe('right');
await element(by.id('Slide2')).swipe('left');
await element(by.id('SkipButton')).tap();

// create new wallet with passphrase
Expand All @@ -38,20 +37,20 @@ d('Onboarding', () => {
await element(by.id('CreateNewWallet')).tap();

// wait for wallet to be created
await waitFor(element(by.id('ToGetStartedClose'))).toBeVisible();
await waitFor(element(by.id('WalletOnboardingClose'))).toBeVisible();
await sleep(1000); // take app some time to load

// try for 3min before fail
for (let i = 0; i < 180; i++) {
await sleep(1000);
try {
await element(by.id('ToGetStartedClose')).tap();
await element(by.id('WalletOnboardingClose')).tap();
await sleep(3000); // wait for redux-persist to save state
break;
} catch (e) {}

if (i === 179) {
throw new Error('Tapping "ToGetStartedClose" timeout');
throw new Error('Tapping "WalletOnboardingClose" timeout');
}
}

Expand All @@ -70,7 +69,6 @@ d('Onboarding', () => {

// get receing address
await element(by.id('Receive')).tap();
await element(by.id('UnderstoodButton')).tap();
await waitFor(element(by.id('QRCode')))
.toBeVisible()
.withTimeout(30000);
Expand All @@ -87,7 +85,7 @@ d('Onboarding', () => {
await waitFor(element(by.id('SkipIntro'))).toBeVisible();
await element(by.id('SkipIntro')).tap();
await element(by.id('RestoreWallet')).tap();
await element(by.id('MultipleButton')).tap();
await element(by.id('MultipleDevices-button')).tap();
await element(by.id('Word-0')).replaceText(seed);
await element(by.id('WordIndex-4')).swipe('up');
await element(by.id('AdvancedButton')).tap();
Expand All @@ -100,20 +98,17 @@ d('Onboarding', () => {
.withTimeout(300000); // 5 min
await element(by.id('GetStartedButton')).tap();

// wait for AssetsTitle to appear and be accessible
// wait for SuggestionsLabel to appear and be accessible
for (let i = 0; i < 60; i++) {
await sleep(1000);
try {
await element(by.id('AssetsTitle')).tap();
await element(by.id('SuggestionsLabel')).tap();
break;
} catch (e) {}
}

// get receing address
await element(by.id('Receive')).tap();
try {
await element(by.id('UnderstoodButton')).tap();
} catch (e) {}
await waitFor(element(by.id('QRCode')))
.toBeVisible()
.withTimeout(30000);
Expand Down
12 changes: 2 additions & 10 deletions e2e/onchain.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ d('Onchain', () => {

for (let i = 0; i < 2; i++) {
await element(by.id('Receive')).tap();
if (i === 0) {
try {
await element(by.id('UnderstoodButton')).tap();
} catch (e) {}
}
await sleep(1000); // animation
// get address from qrcode
let { label: wAddress } = await element(
Expand Down Expand Up @@ -149,7 +144,7 @@ d('Onchain', () => {
).toHaveText('0');

// check Activity
await element(by.id('AssetsTitle')).swipe('up');
await element(by.id('TransferButton')).swipe('up');
await expect(element(by.id('ActivityShort-1'))).toBeVisible();
await expect(element(by.id('ActivityShort-2'))).toBeVisible();
await expect(element(by.id('ActivityShort-3'))).toBeVisible();
Expand Down Expand Up @@ -235,9 +230,6 @@ d('Onchain', () => {
}

await element(by.id('Receive')).tap();
try {
await element(by.id('UnderstoodButton')).tap();
} catch (e) {}
await sleep(1000); // animation
// get address from qrcode
let { label: wAddress } = await element(by.id('QRCode')).getAttributes();
Expand Down Expand Up @@ -316,7 +308,7 @@ d('Onchain', () => {
).toHaveText('0');

// check number of outputs for send tx
await element(by.id('AssetsTitle')).swipe('up');
await element(by.id('TransferButton')).swipe('up');
await expect(element(by.id('ActivityShort-1'))).toBeVisible();
await expect(element(by.id('ActivityShort-2'))).toBeVisible();
await element(by.id('ActivityShowAll')).tap();
Expand Down
1 change: 0 additions & 1 deletion e2e/receive.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ d('Receive', () => {
}

await element(by.id('Receive')).tap();
await element(by.id('UnderstoodButton')).tap();
await sleep(1000); // animation
// await element(by.id('ReceiveCopyQR')).tap();
// await waitFor(element(by.id('ReceiveTooltip1')))
Expand Down
Loading

0 comments on commit 4f8244c

Please sign in to comment.