Skip to content

Commit 21d0420

Browse files
authored
Merge pull request zingolabs#788 from juanky201271/dev_adopt_magic_modals
Adopt magic modals
2 parents 35864eb + d7a52ce commit 21d0420

File tree

66 files changed

+1049
-1516
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1049
-1516
lines changed

.github/workflows/ci.yaml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,22 @@ jobs:
5353
api-level: ${{ matrix.config['api-level'] }}
5454
target: ${{ matrix.config.target }}
5555

56-
android-ubuntu-e2e-test-ci:
57-
strategy:
58-
matrix:
59-
config:
60-
- { abi: x86_64, api-level: 30, target: default }
61-
- { abi: x86, api-level: 28, target: default }
62-
uses: ./.github/workflows/android-ubuntu-e2e-test-ci.yaml
63-
needs: [create-timestamp, android-build]
64-
with:
65-
timestamp: ${{ needs.create-timestamp.outputs.timestamp }}
66-
cache-key: ${{ needs.create-cache-key.outputs.cache-key }}
67-
abi: ${{ matrix.config.abi }}
68-
api-level: ${{ matrix.config['api-level'] }}
69-
target: ${{ matrix.config.target }}
56+
# deactivating these for now, until we know how to fix
57+
# detox run in android
58+
#android-ubuntu-e2e-test-ci:
59+
# strategy:
60+
# matrix:
61+
# config:
62+
# - { abi: x86_64, api-level: 30, target: default }
63+
# - { abi: x86, api-level: 28, target: default }
64+
# uses: ./.github/workflows/android-ubuntu-e2e-test-ci.yaml
65+
# needs: [create-timestamp, android-build]
66+
# with:
67+
# timestamp: ${{ needs.create-timestamp.outputs.timestamp }}
68+
# cache-key: ${{ needs.create-cache-key.outputs.cache-key }}
69+
# abi: ${{ matrix.config.abi }}
70+
# api-level: ${{ matrix.config['api-level'] }}
71+
# target: ${{ matrix.config.target }}
7072

7173
ios-build:
7274
uses: ./.github/workflows/ios-build.yaml
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { View } from 'react-native';
2+
import React from 'react';
3+
4+
export const useMagicModal = jest.fn(() => ({
5+
hide: jest.fn(),
6+
}));
7+
8+
export const magicModal = {
9+
show: jest.fn(),
10+
hide: jest.fn(),
11+
hideAll: jest.fn(),
12+
enableFullWindowOverlay: jest.fn(),
13+
disableFullWindowOverlay: jest.fn(),
14+
};
15+
16+
export const MagicModalPortal = () => <View />;

__tests__/About.snapshot.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ describe('Component About - test', () => {
6666
state.translate = mockTranslate;
6767
state.info = mockInfo;
6868
state.totalBalance = mockTotalBalance;
69-
const onClose = jest.fn();
7069
const about = render(
7170
<ContextAppLoadedProvider value={state}>
72-
<About closeModal={onClose} />
71+
<About />
7372
</ContextAppLoadedProvider>,
7473
);
7574
expect(about.toJSON()).toMatchSnapshot();

__tests__/AddressBook.snapshot.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,10 @@ describe('Component Address Book - test', () => {
6161
const state = defaultAppContextLoaded;
6262
state.addressBook = mockAddressBook;
6363
state.translate = mockTranslate;
64-
const onClose = jest.fn();
6564
const onSet = jest.fn();
6665
const ab: any = render(
6766
<ContextAppLoadedProvider value={state}>
68-
<AddressBook closeModal={onClose} setAddressBook={onSet} />
67+
<AddressBook setAddressBook={onSet} />
6968
</ContextAppLoadedProvider>,
7069
);
7170
expect(ab.toJSON()).toMatchSnapshot();

__tests__/Header.snapshot.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,9 @@ describe('Component Header - test', () => {
8686
<Header
8787
title="title"
8888
testID="valuetransfer text"
89-
poolsMoreInfoOnClick={onFunction}
90-
syncingStatusMoreInfoOnClick={onFunction}
9189
toggleMenuDrawer={onFunction}
92-
setComputingModalVisible={onFunction}
9390
setBackgroundError={onFunction}
9491
setPrivacyOption={onFunction}
95-
setUfvkViewModalVisible={onFunction}
9692
addLastSnackbar={onFunction}
9793
setShieldingAmount={onFunction}
9894
/>

__tests__/History.ValueTransferDetail.unit.tsx

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,17 @@ describe('Component History ValueTransferDetail - test', () => {
105105
state.info = mockInfo;
106106
state.totalBalance = mockTotalBalance;
107107
state.valueTransfers = mockValueTransfers;
108-
const onClose = jest.fn();
109108
const onSetOption = jest.fn();
110-
const onMove = jest.fn();
111109

112110
test('History ValueTransferDetail - sent ValueTransfer with 2 addresses', () => {
113111
render(
114112
<ContextAppLoadedProvider value={state}>
115113
<ValueTransferDetail
116114
index={0}
117-
length={mockValueTransfers.length}
118-
totalLength={mockValueTransfers.length}
119115
vt={mockValueTransfers[0]}
120-
closeModal={onClose}
121-
openModal={onClose}
116+
valueTransfersSliced={mockValueTransfers}
117+
totalLength={mockValueTransfers.length}
122118
setPrivacyOption={onSetOption}
123-
moveValueTransferDetail={onMove}
124119
/>
125120
</ContextAppLoadedProvider>,
126121
).toJSON();
@@ -137,13 +132,10 @@ describe('Component History ValueTransferDetail - test', () => {
137132
<ContextAppLoadedProvider value={state}>
138133
<ValueTransferDetail
139134
index={1}
140-
length={mockValueTransfers.length}
141-
totalLength={mockValueTransfers.length}
142135
vt={mockValueTransfers[1]}
143-
closeModal={onClose}
144-
openModal={onClose}
136+
valueTransfersSliced={mockValueTransfers}
137+
totalLength={mockValueTransfers.length}
145138
setPrivacyOption={onSetOption}
146-
moveValueTransferDetail={onMove}
147139
/>
148140
</ContextAppLoadedProvider>,
149141
);
@@ -158,13 +150,10 @@ describe('Component History ValueTransferDetail - test', () => {
158150
<ContextAppLoadedProvider value={state}>
159151
<ValueTransferDetail
160152
index={2}
161-
length={mockValueTransfers.length}
162-
totalLength={mockValueTransfers.length}
163153
vt={mockValueTransfers[2]}
164-
closeModal={onClose}
165-
openModal={onClose}
154+
valueTransfersSliced={mockValueTransfers}
155+
totalLength={mockValueTransfers.length}
166156
setPrivacyOption={onSetOption}
167-
moveValueTransferDetail={onMove}
168157
/>
169158
</ContextAppLoadedProvider>,
170159
);
@@ -178,13 +167,10 @@ describe('Component History ValueTransferDetail - test', () => {
178167
<ContextAppLoadedProvider value={state}>
179168
<ValueTransferDetail
180169
index={3}
181-
length={mockValueTransfers.length}
182-
totalLength={mockValueTransfers.length}
183170
vt={mockValueTransfers[3]}
184-
closeModal={onClose}
185-
openModal={onClose}
171+
valueTransfersSliced={mockValueTransfers}
172+
totalLength={mockValueTransfers.length}
186173
setPrivacyOption={onSetOption}
187-
moveValueTransferDetail={onMove}
188174
/>
189175
</ContextAppLoadedProvider>,
190176
);
@@ -200,13 +186,10 @@ describe('Component History ValueTransferDetail - test', () => {
200186
<ContextAppLoadedProvider value={state}>
201187
<ValueTransferDetail
202188
index={4}
203-
length={mockValueTransfers.length}
204-
totalLength={mockValueTransfers.length}
205189
vt={mockValueTransfers[4]}
206-
closeModal={onClose}
207-
openModal={onClose}
190+
valueTransfersSliced={mockValueTransfers}
191+
totalLength={mockValueTransfers.length}
208192
setPrivacyOption={onSetOption}
209-
moveValueTransferDetail={onMove}
210193
/>
211194
</ContextAppLoadedProvider>,
212195
);
@@ -219,14 +202,11 @@ describe('Component History ValueTransferDetail - test', () => {
219202
render(
220203
<ContextAppLoadedProvider value={state}>
221204
<ValueTransferDetail
222-
index={4}
223-
length={mockValueTransfers.length}
224-
totalLength={mockValueTransfers.length}
205+
index={5}
225206
vt={mockValueTransfers[5]}
226-
closeModal={onClose}
227-
openModal={onClose}
207+
valueTransfersSliced={mockValueTransfers}
208+
totalLength={mockValueTransfers.length}
228209
setPrivacyOption={onSetOption}
229-
moveValueTransferDetail={onMove}
230210
/>
231211
</ContextAppLoadedProvider>,
232212
);

__tests__/History.snapshot.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,6 @@ describe('Component History - test', () => {
134134
<ContextAppLoadedProvider value={state}>
135135
<History
136136
toggleMenuDrawer={onFunction}
137-
poolsMoreInfoOnClick={onFunction}
138-
syncingStatusMoreInfoOnClick={onFunction}
139-
setComputingModalVisible={onFunction}
140137
setPrivacyOption={onFunction}
141138
setShieldingAmount={onFunction}
142139
setScrollToTop={onFunction}
@@ -162,9 +159,6 @@ describe('Component History - test', () => {
162159
<ContextAppLoadedProvider value={state}>
163160
<History
164161
toggleMenuDrawer={onFunction}
165-
poolsMoreInfoOnClick={onFunction}
166-
syncingStatusMoreInfoOnClick={onFunction}
167-
setComputingModalVisible={onFunction}
168162
setPrivacyOption={onFunction}
169163
setShieldingAmount={onFunction}
170164
setScrollToTop={onFunction}

__tests__/Info.es.unit.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ describe('Component Info - test', () => {
6666
state.info = mockInfo;
6767
state.zecPrice = mockZecPrice;
6868
state.currency = CurrencyEnum.USDCurrency;
69-
const onClose = jest.fn();
7069
render(
7170
<ContextAppLoadedProvider value={state}>
72-
<Info closeModal={onClose} />
71+
<Info />
7372
</ContextAppLoadedProvider>,
7473
);
7574
screen.getByText('$ 33,33');

__tests__/Info.snapshot.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@ describe('Component Info - test', () => {
6868
state.zecPrice = mockZecPrice;
6969
state.translate = mockTranslate;
7070
state.totalBalance = mockTotalBalance;
71-
const onClose = jest.fn();
7271
const info: any = render(
7372
<ContextAppLoadedProvider value={state}>
74-
<Info closeModal={onClose} />
73+
<Info />
7574
</ContextAppLoadedProvider>,
7675
);
7776
expect(info.toJSON()).toMatchSnapshot();

__tests__/Info.us.unit.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ describe('Component Info - test', () => {
6666
state.info = mockInfo;
6767
state.zecPrice = mockZecPrice;
6868
state.currency = CurrencyEnum.USDCurrency;
69-
const onClose = jest.fn();
7069
render(
7170
<ContextAppLoadedProvider value={state}>
72-
<Info closeModal={onClose} />
71+
<Info />
7372
</ContextAppLoadedProvider>,
7473
);
7574
screen.getByText('$ 33.33');

0 commit comments

Comments
 (0)