Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add display name in heading of catalog tab #1074

Merged
merged 31 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
cfc8972
feat: display search result cards in catalog tab
katrinan029 Oct 12, 2023
853811c
fix: failing test in BudgetDetailPage
katrinan029 Oct 13, 2023
2a94621
fix: replace word register with enroll
katrinan029 Oct 13, 2023
3689f23
fix: implemented reviewer comments
katrinan029 Oct 16, 2023
c5f3d6e
fix: lint error
katrinan029 Oct 16, 2023
4695894
chore: rebase
katrinan029 Oct 19, 2023
af78b0d
fix: lint error
katrinan029 Oct 19, 2023
db847ca
feat: added policy's catalog uuid to search filter
katrinan029 Oct 19, 2023
c11a6d3
feat: implement view course button to learn more
katrinan029 Oct 19, 2023
2c7bd80
fix: failing test
katrinan029 Oct 19, 2023
4328754
chore: rebase
katrinan029 Oct 19, 2023
a7158f6
fix: added test
katrinan029 Oct 19, 2023
602cdfa
fix: added test coverage
katrinan029 Oct 19, 2023
08e54d4
fix: refactored based on reviewer feedback
katrinan029 Oct 25, 2023
f95d489
fix: lint error
katrinan029 Oct 25, 2023
94bf5ea
fix: refactored code to include new api field and updated test
katrinan029 Oct 26, 2023
284eade
fix: removing unused prop in test
katrinan029 Oct 26, 2023
491fc21
Merge remote-tracking branch 'origin' into knguyen2/ENT-7591
katrinan029 Oct 26, 2023
f621880
fix: refactored
katrinan029 Oct 26, 2023
5a56945
fix: search filters
katrinan029 Oct 26, 2023
dc7109d
chore: rebase
katrinan029 Oct 27, 2023
b2543ac
chore: rebase
katrinan029 Oct 27, 2023
4173876
feat: add display name
katrinan029 Oct 27, 2023
4736de4
chore: rebase
katrinan029 Oct 27, 2023
74e91df
chore: refactored
katrinan029 Oct 27, 2023
2676168
chore: fix lint error
katrinan029 Oct 27, 2023
2555222
chore: refactored
katrinan029 Oct 30, 2023
9373a68
Merge remote-tracking branch 'origin' into knguyen/ENT-7594
katrinan029 Oct 30, 2023
e48d0b4
chore: rebase
katrinan029 Oct 30, 2023
5447599
Merge remote-tracking branch 'origin' into knguyen2/ENT-7592
katrinan029 Oct 30, 2023
7be9007
fix: refactored and updated test
katrinan029 Oct 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ const CatalogSearch = () => {
data: subsidyAccessPolicy,
} = useSubsidyAccessPolicy(subsidyAccessPolicyId);
const searchFilters = `enterprise_catalog_uuids:${subsidyAccessPolicy.catalogUuid} AND content_type:course`;
const displayName = subsidyAccessPolicy.displayName ? `${subsidyAccessPolicy.displayName} catalog` : 'Overview';

return (
<section>
<FormattedMessage
id="catalogs.enterpriseCatalogs.header"
defaultMessage="Budget associated catalog"
defaultMessage={displayName}
description="Search dialogue."
tagName="h3"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,23 +502,27 @@ describe('<BudgetDetailPage />', () => {
expect(modalPopupContents.getByText(expectedModalPopupContent, { exact: false })).toBeInTheDocument();
});

it('renders with catalog tab active on initial load for assignable budgets', async () => {
it.each([
{ displayName: null },
{ displayName: 'Test Budget Display Name' },
])('renders with catalog tab active on initial load for assignable budgets with %s display name', ({ displayName }) => {
useParams.mockReturnValue({
budgetId: mockSubsidyAccessPolicyUUID,
activeTabKey: 'catalog',
});
useSubsidyAccessPolicy.mockReturnValue({
isInitialLoading: false,
data: mockAssignableSubsidyAccessPolicy,
data: { ...mockAssignableSubsidyAccessPolicy, displayName },
});
useBudgetDetailActivityOverview.mockReturnValueOnce({
isLoading: false,
data: mockEmptyStateBudgetDetailActivityOverview,
});
renderWithRouter(<BudgetDetailPageWrapper />);

const expectedDisplayName = displayName ? `${displayName} catalog` : 'Overview';
// Catalog tab exists and is active
expect(screen.getByText('Catalog').getAttribute('aria-selected')).toBe('true');
expect(screen.getByText(expectedDisplayName, { selector: 'h3' }));
});

it('hides catalog tab when budget is not assignable', () => {
Expand Down