mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #34311 from overleaf/mj-review-panel-with-tabs
[web] Move review panel header into tabs row when open GitOrigin-RevId: e4594040f7a8ca67778fdd3e31cab909b3120adb
This commit is contained in:
committed by
Copybot
parent
aed97f025c
commit
1a7b5e66f5
@@ -18,6 +18,7 @@ import {
|
||||
import { EditorView } from '@codemirror/view'
|
||||
import { EditorState, Transaction } from '@codemirror/state'
|
||||
import { tabsListener } from '@/features/source-editor/extensions/tabs-listener'
|
||||
import ReviewPanelTabsHeaderPortal from '@/features/review-panel/components/review-panel-tabs-header-portal'
|
||||
|
||||
const DOC_IDS = {
|
||||
main: 'doc-main-id',
|
||||
@@ -247,6 +248,7 @@ describe('File Tabs', function () {
|
||||
>
|
||||
<FileSelectionDriver />
|
||||
<TabsContainer />
|
||||
<ReviewPanelTabsHeaderPortal />
|
||||
<RemoteChangeButton />
|
||||
</EditorProviders>
|
||||
)
|
||||
@@ -1158,6 +1160,41 @@ describe('File Tabs', function () {
|
||||
})
|
||||
})
|
||||
|
||||
describe('Review panel header', function () {
|
||||
function toggleReviewPanel() {
|
||||
cy.window().then(win => {
|
||||
win.dispatchEvent(new win.CustomEvent('ui.toggle-review-panel'))
|
||||
})
|
||||
}
|
||||
|
||||
it('does not render the review panel header when the review panel is closed', function () {
|
||||
cy.then(() => selectDoc(DOC_IDS.main))
|
||||
|
||||
cy.findByRole('heading', { name: 'Review' }).should('not.exist')
|
||||
})
|
||||
|
||||
it('renders the review panel header inside the tabs container when the review panel is open', function () {
|
||||
cy.then(() => selectDoc(DOC_IDS.main))
|
||||
|
||||
toggleReviewPanel()
|
||||
|
||||
cy.get('.editor-tabs-container').within(() => {
|
||||
cy.findByRole('heading', { name: 'Review' }).should('exist')
|
||||
})
|
||||
})
|
||||
|
||||
it('removes the review panel header when the review panel is closed again', function () {
|
||||
cy.then(() => selectDoc(DOC_IDS.main))
|
||||
|
||||
toggleReviewPanel()
|
||||
cy.findByRole('heading', { name: 'Review' }).should('exist')
|
||||
|
||||
toggleReviewPanel()
|
||||
|
||||
cy.findByRole('heading', { name: 'Review' }).should('not.exist')
|
||||
})
|
||||
})
|
||||
|
||||
describe('SplitTestBadge', function () {
|
||||
it('renders the labs badge icon in the tabs container', function () {
|
||||
cy.window().then(win => {
|
||||
|
||||
Reference in New Issue
Block a user