-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #339 from openedx/aakbar/PROD-3163
feat: add order history table
- Loading branch information
Showing
11 changed files
with
1,457 additions
and
93 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,19 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import OrderHistory from './orderHistory/OrderHistory'; | ||
|
||
export default function LearnerPurchases({ | ||
user, | ||
}) { | ||
return ( | ||
<div id="learnerPurchasesContainer"> | ||
<OrderHistory | ||
username={user} | ||
/> | ||
</div> | ||
); | ||
} | ||
|
||
LearnerPurchases.propTypes = { | ||
user: PropTypes.string.isRequired, | ||
}; |
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,25 @@ | ||
import React from 'react'; | ||
import { render, queryByAttribute } from '@testing-library/react'; | ||
import '@testing-library/jest-dom'; | ||
import LearnerPurchases from './LearnerPurchases'; | ||
import UserMessagesProvider from '../userMessages/UserMessagesProvider'; | ||
|
||
const LearnerPurchasesWrapper = (props) => ( | ||
<UserMessagesProvider> | ||
<LearnerPurchases {...props} /> | ||
</UserMessagesProvider> | ||
); | ||
|
||
describe('LearnerPurchases', () => { | ||
it('renders the component with the provided user prop', () => { | ||
const user = 'John Doe'; | ||
const getById = queryByAttribute.bind(null, 'id'); | ||
const document = render(<LearnerPurchasesWrapper user={user} />); | ||
const { getByText } = document; | ||
|
||
// Assert that the LearnerPurchasesContainer div is rendered | ||
const container = getById(document.container, 'learnerPurchasesContainer'); | ||
expect(container).toBeInTheDocument(); | ||
expect(getByText('Order History (0)')).toBeInTheDocument(); | ||
}); | ||
}); |
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
Oops, something went wrong.