Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cajubelt committed Oct 13, 2023
1 parent fe55f04 commit 914fea1
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 180 deletions.
5 changes: 2 additions & 3 deletions src/home/ActionsCarousel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('ActionsCarousel', () => {
</Provider>
)

expect(getAllByTestId(/HomeAction-/)).toHaveLength(6)
expect(getAllByTestId(/HomeAction-/)).toHaveLength(5)
})

it('does not render swap action when disabled', () => {
Expand All @@ -47,15 +47,14 @@ describe('ActionsCarousel', () => {
</Provider>
)

expect(getAllByTestId(/HomeAction-/)).toHaveLength(5)
expect(getAllByTestId(/HomeAction-/)).toHaveLength(4)
expect(queryByTestId(`HomeAction/Title-Swap`)).toBeFalsy()
})
it.each([
[HomeActionName.Send, 'send', Screens.Send, undefined],
[HomeActionName.Receive, 'receive', Screens.QRNavigator, { screen: Screens.QRCode }],
[HomeActionName.Add, 'add', Screens.FiatExchangeCurrency, { flow: FiatExchangeFlow.CashIn }],
[HomeActionName.Swap, 'swap', Screens.SwapScreenWithBack, undefined],
[HomeActionName.Request, 'request', Screens.Send, { isOutgoingPaymentRequest: true }],
[HomeActionName.Withdraw, 'withdraw', Screens.WithdrawSpend, undefined],
])(
'renders title and navigates to appropriate screen for %s',
Expand Down
167 changes: 0 additions & 167 deletions src/home/__snapshots__/NotificationBox.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -222,173 +222,6 @@ exports[`NotificationBox renders correctly for with all notifications 1`] = `
</View>
</View>
</View>
<View
style={
{
"margin": 16,
"width": 718,
}
}
testID="NotificationView/incoming_tx_request"
>
<View
style={
[
{
"backgroundColor": "#FFFFFF",
"padding": 16,
},
{
"borderRadius": 8,
},
undefined,
[
{
"borderColor": "#E6E6E6",
"borderWidth": 1,
"flex": 1,
"minHeight": 144,
},
{},
],
]
}
>
<View
style={
{
"flex": 1,
"flexDirection": "row",
}
}
>
<View
style={
{
"width": 40,
}
}
>
<Image
resizeMode="contain"
source={
{
"testUri": "../../../src/images/notification-incoming-request.png",
}
}
/>
</View>
<View
style={
{
"flex": 1,
"justifyContent": "space-between",
"marginLeft": 16,
}
}
>
<Text
style={
{
"color": "#2E3338",
"fontFamily": "Jost-Medium",
"fontSize": 18,
"lineHeight": 22,
"marginBottom": 4,
}
}
testID="undefined/Title"
>
incomingPaymentRequestsSummaryTitle, {"count":2}
</Text>
<Text
numberOfLines={3}
style={
{
"color": "#505050",
"flex": 1,
"fontFamily": "Inter-Regular",
"fontSize": 14,
"lineHeight": 18,
}
}
testID="undefined/Details"
>
incomingPaymentRequestsSummaryDetails, {"context":"exactly2Items"}
</Text>
<View
style={
{
"flexDirection": "row",
"flexWrap": "wrap",
"justifyContent": "flex-start",
}
}
testID="undefined/CallToActions"
>
<View
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"expanded": undefined,
"selected": undefined,
}
}
accessibilityValue={
{
"max": undefined,
"min": undefined,
"now": undefined,
"text": undefined,
}
}
accessible={true}
focusable={true}
nativeBackgroundAndroid={
{
"attribute": "selectableItemBackgroundBorderless",
"rippleRadius": undefined,
"type": "ThemeAttrAndroid",
}
}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
testID="undefined/CallToActions/viewAll/Button"
>
<Text
style={
[
{
"color": "#1AB775",
"fontFamily": "Inter-SemiBold",
"fontSize": 16,
"lineHeight": 22,
},
{
"fontSize": 14,
"lineHeight": 16,
"marginRight": 24,
"minHeight": 16,
"minWidth": 48,
},
]
}
>
viewAll
</Text>
</View>
</View>
</View>
</View>
</View>
</View>
<View
style={
{
Expand Down
1 change: 0 additions & 1 deletion src/home/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export enum HomeActionName {
Receive = 'Receive',
Add = 'Add',
Swap = 'Swap',
Request = 'Request',
Withdraw = 'Withdraw',
}

Expand Down
4 changes: 0 additions & 4 deletions src/send/Send.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
} from 'test/values'

const mockScreenProps = (params: {
isOutgoingPaymentRequest?: boolean
skipContactsImport?: boolean
forceTokenId?: boolean
defaultTokenIdOverride?: string
Expand Down Expand Up @@ -140,7 +139,6 @@ describe('Send', () => {
await waitFor(() => expect(navigate).toHaveBeenCalledTimes(1))
expect(navigate).toHaveBeenCalledWith(Screens.SendAmount, {
recipient: expect.objectContaining(mockRecipient),
isOutgoingPaymentRequest: false,
origin: SendOrigin.AppSendFlow,
defaultTokenIdOverride: mockCusdTokenId,
isFromScan: false,
Expand All @@ -154,7 +152,6 @@ describe('Send', () => {
<Provider store={store}>
<Send
{...mockScreenProps({
isOutgoingPaymentRequest: true,
defaultTokenIdOverride: mockCeloTokenId,
forceTokenId: true,
})}
Expand All @@ -167,7 +164,6 @@ describe('Send', () => {
await waitFor(() => expect(navigate).toHaveBeenCalledTimes(1))
expect(navigate).toHaveBeenCalledWith(Screens.SendAmount, {
recipient: expect.objectContaining(mockRecipient),
isOutgoingPaymentRequest: true,
origin: SendOrigin.AppSendFlow,
defaultTokenIdOverride: mockCeloTokenId,
forceTokenId: true,
Expand Down
3 changes: 0 additions & 3 deletions src/send/SendAmount/SendAmount.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,9 @@ const mockTransactionData2 = {

const mockScreenProps = ({
defaultTokenIdOverride,
isOutgoingPaymentRequest,
forceTokenId,
}: {
defaultTokenIdOverride?: string
isOutgoingPaymentRequest?: boolean
forceTokenId?: boolean
}) =>
getMockStackScreenProps(Screens.SendAmount, {
Expand Down Expand Up @@ -337,7 +335,6 @@ describe('SendAmount', () => {
<Provider store={store}>
<SendAmount
{...mockScreenProps({
isOutgoingPaymentRequest: false,
defaultTokenIdOverride: mockTestTokenTokenId,
forceTokenId: true,
})}
Expand Down
2 changes: 0 additions & 2 deletions src/send/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ describe('send/utils', () => {
expect.objectContaining({
origin: SendOrigin.AppSendFlow,
recipient: { address: mockData.address, recipientType: RecipientType.Address },
isOutgoingPaymentRequest: undefined,
forceTokenId: true,
defaultTokenIdOverride: mockCeurTokenId,
})
Expand All @@ -84,7 +83,6 @@ describe('send/utils', () => {
expect.objectContaining({
origin: SendOrigin.AppSendFlow,
recipient: { address: mockData.address, recipientType: RecipientType.Address },
isOutgoingPaymentRequest: undefined,
forceTokenId: false,
})
)
Expand Down

0 comments on commit 914fea1

Please sign in to comment.