Skip to content

Commit

Permalink
2.3.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
karamem0 committed Oct 30, 2024
1 parent 2603c30 commit 68e0c5d
Show file tree
Hide file tree
Showing 9 changed files with 639 additions and 179 deletions.
3 changes: 3 additions & 0 deletions source/client/src/common/components/SidePanel.presenter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { css } from '@emotion/react';
interface SidePanelProps {
content?: React.ReactNode,
loading?: boolean,
mountNode?: HTMLElement,
open?: boolean,
title?: React.ReactNode,
onOpenChange?: EventHandler<boolean>
Expand All @@ -34,6 +35,7 @@ function SidePanel(props: Readonly<React.PropsWithChildren<SidePanelProps>>) {
children,
content,
loading,
mountNode,
open,
title,
onOpenChange
Expand All @@ -44,6 +46,7 @@ function SidePanel(props: Readonly<React.PropsWithChildren<SidePanelProps>>) {
{children}
<OverlayDrawer
as="aside"
mountNode={mountNode}
open={open}
position="end"
size="small"
Expand Down
34 changes: 32 additions & 2 deletions source/client/src/common/components/SidePanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,50 @@ import SidePanel from './SidePanel.presenter';
import ThemeProvider from '../../providers/ThemeProvider';
import { render } from '@testing-library/react';

it('should create shapshot', async () => {
it('should create shapshot of when loading is true', async () => {
const container = document.body.appendChild(document.createElement('div'));
const params = {
content: (
<div data-testid="Content" />
),
mountNode: container,
loading: true,
open: true,
title: (
<div data-testid="Title" />
)
};
const { asFragment } = render(
<ThemeProvider>
<SidePanel {...params} />
</ThemeProvider>,
{
container
}
);
expect(asFragment()).toMatchSnapshot();
});

it('should create shapshot of when loading is false', async () => {
const container = document.body.appendChild(document.createElement('div'));
const params = {
content: (
<div data-testid="Content" />
),
mountNode: container,
loading: false,
open: true,
title: (
<div data-testid="Title" />
)
};
const { asFragment } = render(
<ThemeProvider>
<SidePanel {...params} />
</ThemeProvider>
</ThemeProvider>,
{
container
}
);
expect(asFragment()).toMatchSnapshot();
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,193 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`should create shapshot 1`] = `
exports[`should create shapshot of when loading is false 1`] = `
<DocumentFragment>
<div
aria-hidden="true"
class="rmnljus fui-OverlayDrawer__backdrop ___mgf8q40_1ccxybz f1euv43f"
/>
.emotion-0 {
font-size: 1rem;
line-height: 1rem;
}
.emotion-1 {
margin-bottom: 1rem;
}
<aside
aria-labelledby="dialog-title-r6"
aria-modal="true"
class="fui-OverlayDrawer r7dfyj8 ___12p5wfa_jv28t00 fsqykmd f1e31b4d frppm18 f1exhnwo f1euv43f"
data-tabster="{"restorer":{"type":0},"modalizer":{"id":"modal-r5","isOthersAccessible":false,"isTrapped":true}}"
role="dialog"
tabindex="-1"
>
<header
class="fui-DrawerHeader r3ovn4i"
role="none"
>
<div
class="fui-DrawerHeaderTitle ___1g6dz7n_17w6zju f22iagw f1869bpl f122n59 fsnqrgy"
>
<h2
class="fui-DrawerHeaderTitle__heading fui-DialogTitle rxjm636"
id="dialog-title-r6"
>
<div
data-testid="Title"
/>
</h2>
<div
class="fui-DrawerHeaderTitle__action fui-DialogTitle__action r13kcrze ___zdrx2v0_7c5v900 faqnl2i"
>
<button
aria-label="Close"
class="fui-Button r1alrhcs ___w3o4yv0_df8ghi0 fhovq9v f1p3nwhy f11589ue f1q5o8ev f1pdflbu fkfq4zb f1t94bn6 f1s2uweq fr80ssc f1ukrpxl fecsdlb fnwyq0v ft1hn21 fuxngvv fy5bs14 fsv2rcd f1h0usnq fs4ktlq f16h9ulv fx2bmrt f1omzyqd f1dfjoow f1j98vj9 fj8yq94 f4xjyn1 f1et0tmh f9ddjv3 f1wi8ngl f18ktai2 fwbmr0d f44c6la"
type="button"
>
<span
class="fui-Button__icon rywnvv2"
>
<span
aria-hidden="true"
class="root_dd790ee3 emotion-0"
>
<svg
class="svg_dd790ee3"
focusable="false"
viewBox="0 0 2048 2048"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M1115 1024l690 691-90 90-691-690-691 690-90-90 690-691-690-691 90-90 691 690 691-690 90 90-690 691z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
</header>
<div
class="fui-DrawerBody ri6rvx7 emotion-1"
role="group"
tabindex="0"
>
<div
data-testid="Content"
/>
</div>
</aside>
.emotion-0 {
min-height: 100vh;
line-height: 1.25em;
background-color: #f5f5f5;
}
<div
class="fui-FluentProvider fui-FluentProviderr4 ___jdtuxv0_17k0bs4 f19n0e5 fxugw4r f1o700av fk6fouc fkhj508 figsok6 f1i3iumi"
dir="ltr"
>
<div
class="emotion-0"
>
<span
hidden=""
/>
</div>
</div>
</DocumentFragment>
`;

exports[`should create shapshot of when loading is true 1`] = `
<DocumentFragment>
<div
aria-hidden="true"
class="rmnljus fui-OverlayDrawer__backdrop ___mgf8q40_1ccxybz f1euv43f"
/>
.emotion-0 {
font-size: 1rem;
line-height: 1rem;
}
.emotion-1 {
margin-bottom: 1rem;
}
<aside
aria-labelledby="dialog-title-r2"
aria-modal="true"
class="fui-OverlayDrawer r7dfyj8 ___12p5wfa_jv28t00 fsqykmd f1e31b4d frppm18 f1exhnwo f1euv43f"
data-tabster="{"restorer":{"type":0},"modalizer":{"id":"modal-r1","isOthersAccessible":false,"isTrapped":true}}"
role="dialog"
tabindex="-1"
>
<header
class="fui-DrawerHeader r3ovn4i"
role="none"
>
<div
class="fui-DrawerHeaderTitle ___1g6dz7n_17w6zju f22iagw f1869bpl f122n59 fsnqrgy"
>
<h2
class="fui-DrawerHeaderTitle__heading fui-DialogTitle rxjm636"
id="dialog-title-r2"
>
<div
data-testid="Title"
/>
</h2>
<div
class="fui-DrawerHeaderTitle__action fui-DialogTitle__action r13kcrze ___zdrx2v0_7c5v900 faqnl2i"
>
<button
aria-label="Close"
class="fui-Button r1alrhcs ___w3o4yv0_df8ghi0 fhovq9v f1p3nwhy f11589ue f1q5o8ev f1pdflbu fkfq4zb f1t94bn6 f1s2uweq fr80ssc f1ukrpxl fecsdlb fnwyq0v ft1hn21 fuxngvv fy5bs14 fsv2rcd f1h0usnq fs4ktlq f16h9ulv fx2bmrt f1omzyqd f1dfjoow f1j98vj9 fj8yq94 f4xjyn1 f1et0tmh f9ddjv3 f1wi8ngl f18ktai2 fwbmr0d f44c6la"
type="button"
>
<span
class="fui-Button__icon rywnvv2"
>
<span
aria-hidden="true"
class="root_dd790ee3 emotion-0"
>
<svg
class="svg_dd790ee3"
focusable="false"
viewBox="0 0 2048 2048"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M1115 1024l690 691-90 90-691-690-691 690-90-90 690-691-690-691 90-90 691 690 691-690 90 90-690 691z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
</header>
<div
class="fui-DrawerBody ri6rvx7 emotion-1"
role="group"
tabindex="0"
>
<div
class="fui-Spinner r82apo5"
role="progressbar"
>
<span
class="fui-Spinner__spinner rvgcg50 ___1xxu43e_eahmz60 f1d2rq10 f1szoe96 fb52u90"
>
<span
class="fui-Spinner__spinnerTail rxov3xa"
/>
</span>
</div>
</div>
</aside>
.emotion-0 {
min-height: 100vh;
line-height: 1.25em;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ import { MembershipType } from '../../../types/Entity';
import ThemeProvider from '../../../providers/ThemeProvider';
import { render } from '@testing-library/react';

jest.mock('../../../common/components/SidePanel', () =>
function SidePanel({ content, renderer }: { content: React.ReactNode, renderer: (props: unknown) => React.ReactNode }) {
return (
<div data-testid="SidePanel">
<div data-testid="Content">
{content}
</div>
<div data-testid="Renderer">
{renderer({})}
</div>
</div>
);
});

it('should create shapshot', async () => {
const params = {
items: [
Expand Down
14 changes: 14 additions & 0 deletions source/client/src/features/team/components/MemberMenuItem.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ import MemberMenuItem from './MemberMenuItem.presenter';
import ThemeProvider from '../../../providers/ThemeProvider';
import { render } from '@testing-library/react';

jest.mock('../../../common/components/SidePanel', () =>
function SidePanel({ content, renderer }: { content: React.ReactNode, renderer: (props: unknown) => React.ReactNode }) {
return (
<div data-testid="SidePanel">
<div data-testid="Content">
{content}
</div>
<div data-testid="Renderer">
{renderer({})}
</div>
</div>
);
});

it('should create shapshot', async () => {
const params = {
items: [
Expand Down
52 changes: 17 additions & 35 deletions source/client/src/features/team/components/TagMenuItem.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@

import React from 'react';

import { render, screen } from '@testing-library/react';
import IntlProvider from '../../../providers/IntlProvider';
import TagMenuItem from './TagMenuItem.presenter';
import ThemeProvider from '../../../providers/ThemeProvider';
import userEvent from '@testing-library/user-event';
import { render } from '@testing-library/react';

jest.mock('./TagMemberAccordionItem', () =>
function TagMemberAccordionItem({ children }: React.PropsWithChildren<unknown>) {
Expand All @@ -23,36 +22,21 @@ jest.mock('./TagMemberAccordionItem', () =>
);
});

const setup = (jsx: JSX.Element) => ({
user: userEvent.setup(),
...render(jsx)
});

it('should create shapshot of when loading is true', async () => {
const params = {
id: '2bd9fd6-8f93-4758-87c3-1fb73740a315',
items: [
{
id: 'MjQzMmI1N2ItMGFiZC00M2RiLWFhN2ItMTZlYWRkMTE1ZDM0IyM3ZDg4M2Q4Yi1hMTc5LTRkZDctOTNiMy1hOGQzZGUxYTIxMmUjI3RhY29VSjN2RGk==',
displayName: 'Finance',
description: 'Finance Team for Mach 8 Project',
memberCount: 2
}
],
loading: false
};
const { asFragment, user } = setup(
<IntlProvider>
<ThemeProvider>
<TagMenuItem {...params} />
</ThemeProvider>
</IntlProvider>
);
await user.click(screen.getByRole('button'));
expect(asFragment()).toMatchSnapshot();
});
jest.mock('../../../common/components/SidePanel', () =>
function SidePanel({ content, renderer }: { content: React.ReactNode, renderer: (props: unknown) => React.ReactNode }) {
return (
<div data-testid="SidePanel">
<div data-testid="Content">
{content}
</div>
<div data-testid="Renderer">
{renderer({})}
</div>
</div>
);
});

it('should create shapshot of when loading is false', async () => {
it('should create shapshot', () => {
const params = {
id: '2bd9fd6-8f93-4758-87c3-1fb73740a315',
items: [
Expand All @@ -62,16 +46,14 @@ it('should create shapshot of when loading is false', async () => {
description: 'Finance Team for Mach 8 Project',
memberCount: 2
}
],
loading: false
]
};
const { asFragment, user } = setup(
const { asFragment } = render(
<IntlProvider>
<ThemeProvider>
<TagMenuItem {...params} />
</ThemeProvider>
</IntlProvider>
);
await user.click(screen.getByRole('button'));
expect(asFragment()).toMatchSnapshot();
});
Loading

0 comments on commit 68e0c5d

Please sign in to comment.