[web] Show DS Navigation for all SAAS users regardless of feature flag (#23801)

* Remove `sidebar-navigation-ui-update` as true from analytics events

* Hide "ds-nav" survey for users who have the feature flag

* Replace `useIsDsNav()` by `isOverleaf`

* Rename former `hideDsSurvey` to `hideDsSurvey`, and set `hasDsNav = isOverleaf` variable

so the intent is clearer.

* Update frontend tests

GitOrigin-RevId: 2be9f88a10da430c0429de15d777d98104327f9f
This commit is contained in:
Antoine Clausse
2025-02-24 09:06:04 +00:00
committed by Copybot
parent f2aa79f49d
commit c31dffc605
9 changed files with 45 additions and 28 deletions
@@ -42,7 +42,7 @@ describe('<TagsList />', function () {
it('displays the tags list', function () {
const header = screen.getByTestId('organize-projects')
expect(header.textContent).to.equal('Organize Projects')
expect(header.textContent).to.equal('Organize Tags')
screen.getByRole('button', {
name: 'New Tag',
@@ -1,8 +1,9 @@
import { expect } from 'chai'
import { fireEvent, render, screen } from '@testing-library/react'
import SurveyWidget from '../../../../../frontend/js/features/project-list/components/survey-widget'
import { SurveyWidgetDsNav } from '../../../../../frontend/js/features/project-list/components/survey-widget-ds-nav'
import { SplitTestProvider } from '@/shared/context/split-test-context'
describe('<SurveyWidget />', function () {
describe('<SurveyWidgetDsNav />', function () {
beforeEach(function () {
this.name = 'my-survey'
this.preText = 'To help shape the future of Overleaf'
@@ -21,7 +22,11 @@ describe('<SurveyWidget />', function () {
url: this.url,
})
render(<SurveyWidget />)
render(
<SplitTestProvider>
<SurveyWidgetDsNav />
</SplitTestProvider>
)
})
it('shows text and link', function () {
@@ -29,9 +34,10 @@ describe('<SurveyWidget />', function () {
expect(dismissed).to.equal(null)
screen.getByText(this.preText)
screen.getByText(this.linkText)
const link = screen.getByRole('link', {
name: this.linkText,
name: 'Take survey',
}) as HTMLAnchorElement
expect(link.href).to.equal(this.url)
})
@@ -63,7 +69,11 @@ describe('<SurveyWidget />', function () {
})
localStorage.setItem('dismissed-my-survey', 'true')
render(<SurveyWidget />)
render(
<SplitTestProvider>
<SurveyWidgetDsNav />
</SplitTestProvider>
)
})
it('nothing is displayed', function () {
@@ -77,7 +87,11 @@ describe('<SurveyWidget />', function () {
describe('survey widget is not shown when no survey is configured', function () {
beforeEach(function () {
render(<SurveyWidget />)
render(
<SplitTestProvider>
<SurveyWidgetDsNav />
</SplitTestProvider>
)
})
it('nothing is displayed', function () {
@@ -63,12 +63,14 @@ describe('<ProjectTools />', function () {
projects,
totalSize: 100,
})
window.metaAttributesCache.set('ol-footer', {
showThinFooter: false,
translatedLanguages: { en: 'English' },
subdomainLang: { en: { lngCode: 'en', url: 'overleaf.com' } },
})
window.metaAttributesCache.set('ol-navbar', {
items: [],
})
fetchMock.get('/system/messages', [])
})