This repository has been archived by the owner on Oct 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a2f97d
commit 3ebae15
Showing
12 changed files
with
357 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/components/Transactions/spec/TransactionDetail.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { render } from "@testing-library/react"; | ||
import { TransactionDetailView } from "components/Transactions/TransactionDetail"; | ||
import Transaction from "data/Transaction"; | ||
import { Map } from 'immutable'; | ||
import moment from "moment"; | ||
|
||
|
||
describe('transaction detail view', () => { | ||
it('will render', () => { | ||
render(<TransactionDetailView | ||
transaction={ new Transaction({ | ||
name: 'Dumb Stuff', | ||
date: moment(), | ||
}) } | ||
spending={ new Map() } | ||
/>); | ||
|
||
// Make sure it's actually there. | ||
expect(document.querySelector('.transaction-detail')).not.toBeEmptyDOMElement(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
30 changes: 30 additions & 0 deletions
30
src/shared/fundingSchedules/actions/fetchFundingSchedulesIfNeeded.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Dispatch } from "redux"; | ||
import { getSelectedBankAccountId } from "shared/bankAccounts/selectors/getSelectedBankAccountId"; | ||
import request from "shared/util/request"; | ||
|
||
interface GetState { | ||
(): object | ||
} | ||
|
||
interface ActionWithState { | ||
(dispatch: Dispatch, getState: GetState): Promise<void> | ||
} | ||
|
||
export function fetchFundingSchedulesIfNeeded(): ActionWithState { | ||
return (dispatch, getState) => { | ||
const selectedBankAccountId = getSelectedBankAccountId(getState()); | ||
if (!selectedBankAccountId) { | ||
// If the user does not have a bank account selected, then there are no transactions we can request. | ||
return Promise.resolve(); | ||
} | ||
|
||
return request() | ||
.get(`/bank_accounts/${ selectedBankAccountId }/funding_schedules`) | ||
.then(result => { | ||
|
||
}) | ||
.catch(error => { | ||
|
||
}); | ||
}; | ||
} |
Oops, something went wrong.