Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 6755c48

Browse files
valentinewallacetanx
authored andcommitted
Hook up PaymentFailed screen in main/nav.
1 parent 6ffccc9 commit 6755c48

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/action/nav.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ class NavAction {
7373
this._store.route = 'PayLightningDone';
7474
}
7575

76+
goPaymentFailed() {
77+
this._store.route = 'PaymentFailed';
78+
}
79+
7680
goPayBitcoin() {
7781
this._store.route = 'PayBitcoin';
7882
}

src/view/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import Home from './home';
1919
import Payment from './payment';
2020
import PayLightningConfirm from './pay-lightning-confirm';
2121
import PayLightningDone from './pay-lightning-done';
22+
import PaymentFailed from './payment-failed';
2223
import PayBitcoin from './pay-bitcoin';
2324
import PayBitcoinConfirm from './pay-bitcoin-confirm';
2425
import PayBitcoinDone from './pay-bitcoin-done';
@@ -111,6 +112,9 @@ class MainView extends Component {
111112
{route === 'PayLightningDone' && (
112113
<PayLightningDone store={store} payment={payment} nav={nav} />
113114
)}
115+
{route === 'PaymentFailed' && (
116+
<PaymentFailed channel={channel} payment={payment} />
117+
)}
114118
{route === 'PayBitcoin' && (
115119
<PayBitcoin store={store} payment={payment} nav={nav} />
116120
)}

test/unit/action/nav.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ describe('Action Nav Unit Tests', () => {
130130
});
131131
});
132132

133+
describe('goPaymentFailed()', () => {
134+
it('should set correct route', () => {
135+
nav.goPaymentFailed();
136+
expect(store.route, 'to equal', 'PaymentFailed');
137+
});
138+
});
139+
133140
describe('goPayBitcoin()', () => {
134141
it('should set correct route', () => {
135142
nav.goPayBitcoin();

0 commit comments

Comments
 (0)