This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…gs for 6.1 release (#9002) * Address style bugs for 6.1 release * Fix snapshots * QA feedback * fix linting * final QA feedback * Fix tests * Fix checkmark icon for status dropdown - dnd * fix menu icon in dark theme * linter * rearrange status dropdown checkmark Co-authored-by: Nevyana Angelova <[email protected]> Co-authored-by: Mattermod <[email protected]>
- Loading branch information
1 parent
8bb879e
commit 4c37380
Showing
17 changed files
with
467 additions
and
66 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
...l_header/right_controls/at_mentions_button/__snapshots__/at_mentions_button.test.tsx.snap
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,52 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`components/global/AtMentionsButton should match snapshot 1`] = ` | ||
<OverlayTrigger | ||
defaultOverlayShown={false} | ||
delayShow={400} | ||
overlay={ | ||
<Tooltip | ||
bsClass="tooltip" | ||
id="recentMentions" | ||
placement="right" | ||
> | ||
<Memo(MemoizedFormattedMessage) | ||
defaultMessage="Recent mentions" | ||
id="channel_header.recentMentions" | ||
/> | ||
<Memo(KeyboardShortcutSequence) | ||
hideDescription={true} | ||
isInsideTooltip={true} | ||
shortcut={ | ||
Object { | ||
"default": Object { | ||
"defaultMessage": "Recent mentions: Ctrl|Shift|M", | ||
"id": "shortcuts.nav.recent_mentions", | ||
}, | ||
"mac": Object { | ||
"defaultMessage": "Recent mentions: ⌘|Shift|M", | ||
"id": "shortcuts.nav.recent_mentions.mac", | ||
}, | ||
} | ||
} | ||
/> | ||
</Tooltip> | ||
} | ||
placement="bottom" | ||
trigger={ | ||
Array [ | ||
"hover", | ||
] | ||
} | ||
> | ||
<ForwardRef | ||
aria-label="Select to toggle a list of recent mentions." | ||
compact={true} | ||
icon="at" | ||
inverted={true} | ||
onClick={[Function]} | ||
size="sm" | ||
toggled={false} | ||
/> | ||
</OverlayTrigger> | ||
`; |
44 changes: 44 additions & 0 deletions
44
components/global_header/right_controls/at_mentions_button/at_mentions_button.test.tsx
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,44 @@ | ||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. | ||
// See LICENSE.txt for license information. | ||
|
||
import React from 'react'; | ||
import {shallow} from 'enzyme'; | ||
|
||
import IconButton from '@mattermost/compass-components/components/icon-button'; | ||
|
||
import {GlobalState} from 'types/store'; | ||
|
||
import AtMentionsButton from './at_mentions_button'; | ||
|
||
const mockDispatch = jest.fn(); | ||
let mockState: GlobalState; | ||
|
||
jest.mock('react-redux', () => ({ | ||
...jest.requireActual('react-redux') as typeof import('react-redux'), | ||
useSelector: (selector: (state: typeof mockState) => unknown) => selector(mockState), | ||
useDispatch: () => mockDispatch, | ||
})); | ||
|
||
describe('components/global/AtMentionsButton', () => { | ||
beforeEach(() => { | ||
mockState = {views: {rhs: {isSidebarOpen: true}}} as GlobalState; | ||
}); | ||
|
||
test('should match snapshot', () => { | ||
const wrapper = shallow( | ||
<AtMentionsButton/>, | ||
); | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
|
||
test('should show active mentions', () => { | ||
const wrapper = shallow( | ||
<AtMentionsButton/>, | ||
); | ||
|
||
wrapper.find(IconButton).simulate('click', { | ||
preventDefault: jest.fn(), | ||
}); | ||
expect(mockDispatch).toHaveBeenCalledTimes(1); | ||
}); | ||
}); |
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
36 changes: 36 additions & 0 deletions
36
...l_header/right_controls/saved_posts_button/__snapshots__/saved_posts_button.test.tsx.snap
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,36 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`components/global/AtMentionsButton should match snapshot 1`] = ` | ||
<OverlayTrigger | ||
defaultOverlayShown={false} | ||
delayShow={400} | ||
overlay={ | ||
<Tooltip | ||
bsClass="tooltip" | ||
id="recentMentions" | ||
placement="right" | ||
> | ||
<Memo(MemoizedFormattedMessage) | ||
defaultMessage="Saved posts" | ||
id="channel_header.flagged" | ||
/> | ||
</Tooltip> | ||
} | ||
placement="bottom" | ||
trigger={ | ||
Array [ | ||
"hover", | ||
] | ||
} | ||
> | ||
<ForwardRef | ||
aria-label="Select to toggle a list of saved posts." | ||
compact={true} | ||
icon="bookmark-outline" | ||
inverted={true} | ||
onClick={[Function]} | ||
size="sm" | ||
toggled={false} | ||
/> | ||
</OverlayTrigger> | ||
`; |
44 changes: 44 additions & 0 deletions
44
components/global_header/right_controls/saved_posts_button/saved_posts_button.test.tsx
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,44 @@ | ||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. | ||
// See LICENSE.txt for license information. | ||
|
||
import React from 'react'; | ||
import {shallow} from 'enzyme'; | ||
|
||
import IconButton from '@mattermost/compass-components/components/icon-button'; | ||
|
||
import {GlobalState} from 'types/store'; | ||
|
||
import SavedPostsButton from './saved_posts_button'; | ||
|
||
const mockDispatch = jest.fn(); | ||
let mockState: GlobalState; | ||
|
||
jest.mock('react-redux', () => ({ | ||
...jest.requireActual('react-redux') as typeof import('react-redux'), | ||
useSelector: (selector: (state: typeof mockState) => unknown) => selector(mockState), | ||
useDispatch: () => mockDispatch, | ||
})); | ||
|
||
describe('components/global/AtMentionsButton', () => { | ||
beforeEach(() => { | ||
mockState = {views: {rhs: {isSidebarOpen: true}}} as GlobalState; | ||
}); | ||
|
||
test('should match snapshot', () => { | ||
const wrapper = shallow( | ||
<SavedPostsButton/>, | ||
); | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
|
||
test('should show active mentions', () => { | ||
const wrapper = shallow( | ||
<SavedPostsButton/>, | ||
); | ||
|
||
wrapper.find(IconButton).simulate('click', { | ||
preventDefault: jest.fn(), | ||
}); | ||
expect(mockDispatch).toHaveBeenCalledTimes(1); | ||
}); | ||
}); |
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
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.