From 68e0c5ddd787987dbb623a6e0f2adb994a1797b8 Mon Sep 17 00:00:00 2001 From: Takashi Shinohara Date: Wed, 30 Oct 2024 18:02:07 +0900 Subject: [PATCH] 2.3.1 release --- .../common/components/SidePanel.presenter.tsx | 3 + .../src/common/components/SidePanel.test.tsx | 34 +++- .../__snapshots__/SidePanel.test.tsx.snap | 188 +++++++++++++++++- .../team/components/ChannelMenuItem.test.tsx | 14 ++ .../team/components/MemberMenuItem.test.tsx | 14 ++ .../team/components/TagMenuItem.test.tsx | 52 ++--- .../ChannelMenuItem.test.tsx.snap | 173 ++++++++++++++-- .../MemberMenuItem.test.tsx.snap | 185 +++++++++++++++-- .../__snapshots__/TagMenuItem.test.tsx.snap | 155 ++++++--------- 9 files changed, 639 insertions(+), 179 deletions(-) diff --git a/source/client/src/common/components/SidePanel.presenter.tsx b/source/client/src/common/components/SidePanel.presenter.tsx index 86e32de1..cb669113 100644 --- a/source/client/src/common/components/SidePanel.presenter.tsx +++ b/source/client/src/common/components/SidePanel.presenter.tsx @@ -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 @@ -34,6 +35,7 @@ function SidePanel(props: Readonly>) { children, content, loading, + mountNode, open, title, onOpenChange @@ -44,6 +46,7 @@ function SidePanel(props: Readonly>) { {children} { +it('should create shapshot of when loading is true', async () => { + const container = document.body.appendChild(document.createElement('div')); const params = { + content: ( +
+ ), + mountNode: container, + loading: true, open: true, + title: ( +
+ ) + }; + const { asFragment } = render( + + + , + { + 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: (
), + mountNode: container, + loading: false, + open: true, title: (
) @@ -25,7 +52,10 @@ it('should create shapshot', async () => { const { asFragment } = render( - + , + { + container + } ); expect(asFragment()).toMatchSnapshot(); }); diff --git a/source/client/src/common/components/__snapshots__/SidePanel.test.tsx.snap b/source/client/src/common/components/__snapshots__/SidePanel.test.tsx.snap index 787192d5..53660159 100644 --- a/source/client/src/common/components/__snapshots__/SidePanel.test.tsx.snap +++ b/source/client/src/common/components/__snapshots__/SidePanel.test.tsx.snap @@ -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`] = ` +
diff --git a/source/client/src/features/team/components/__snapshots__/MemberMenuItem.test.tsx.snap b/source/client/src/features/team/components/__snapshots__/MemberMenuItem.test.tsx.snap index a192b4c9..25280b70 100644 --- a/source/client/src/features/team/components/__snapshots__/MemberMenuItem.test.tsx.snap +++ b/source/client/src/features/team/components/__snapshots__/MemberMenuItem.test.tsx.snap @@ -9,6 +9,51 @@ exports[`should create shapshot 1`] = ` } .emotion-1 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-flex-flow: column; + -webkit-flex-flow: column; + -ms-flex-flow: column; + flex-flow: column; + grid-gap: 0.5rem; +} + +.emotion-2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-flex-flow: column; + -webkit-flex-flow: column; + -ms-flex-flow: column; + flex-flow: column; + grid-gap: 0.5rem; + height: calc(100vh - 8rem); + overflow: auto; +} + +.emotion-3 { + display: grid; + grid-template-columns: auto auto; + grid-gap: 0.5rem; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: left; + -ms-flex-pack: left; + -webkit-justify-content: left; + justify-content: left; + padding: 0.5rem; +} + +.emotion-3:hover { + background-color: #f5f5f5; +} + +.emotion-4 { display: grid; grid-template-rows: auto; grid-template-columns: auto auto; @@ -24,7 +69,7 @@ exports[`should create shapshot 1`] = ` cursor: pointer; } -.emotion-2 { +.emotion-5 { font-size: 1rem; line-height: 1rem; } @@ -36,35 +81,131 @@ exports[`should create shapshot 1`] = `
- -
+
+
+ + - - +
+
diff --git a/source/client/src/features/team/components/__snapshots__/TagMenuItem.test.tsx.snap b/source/client/src/features/team/components/__snapshots__/TagMenuItem.test.tsx.snap index 0f549f16..3df27560 100644 --- a/source/client/src/features/team/components/__snapshots__/TagMenuItem.test.tsx.snap +++ b/source/client/src/features/team/components/__snapshots__/TagMenuItem.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`should create shapshot of when loading is false 1`] = ` +exports[`should create shapshot 1`] = ` .emotion-0 { min-height: 100vh; @@ -9,79 +9,20 @@ exports[`should create shapshot of when loading is false 1`] = ` } .emotion-1 { - display: grid; - grid-template-rows: auto; - grid-template-columns: auto auto; - grid-gap: 0.25rem; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - cursor: pointer; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-flex-flow: column; + -webkit-flex-flow: column; + -ms-flex-flow: column; + flex-flow: column; + grid-gap: 0.5rem; + height: calc(100vh - 5.5rem); + overflow: auto; } .emotion-2 { - font-size: 1rem; - line-height: 1rem; -} - -
-
- - - -
-
-
-`; - -exports[`should create shapshot of when loading is true 1`] = ` - - .emotion-0 { - min-height: 100vh; - line-height: 1.25em; - background-color: #f5f5f5; -} - -.emotion-1 { display: grid; grid-template-rows: auto; grid-template-columns: auto auto; @@ -97,7 +38,7 @@ exports[`should create shapshot of when loading is true 1`] = ` cursor: pointer; } -.emotion-2 { +.emotion-3 { font-size: 1rem; line-height: 1rem; } @@ -109,38 +50,58 @@ exports[`should create shapshot of when loading is true 1`] = `
- - - - -
+