Merge pull request #36649 from overleaf/dp-cleanup-library-feature-flag

Remove the overleaf-library feature flag

GitOrigin-RevId: ebeabd43c9e44dbc2344b4e8e7e5b9095fcc86e0
This commit is contained in:
David
2026-09-17 12:04:13 +00:00
committed by Copybot
parent 6c802c03a6
commit 90be47c5e1
18 changed files with 148 additions and 237 deletions
@@ -33,6 +33,19 @@ const {
const userId = owner.id
// The sidebar's trash page switcher and the per-row trash action buttons share
// the accessible name "Trash", so pick the one outside the project table.
function getSidebarTrashButton() {
const table = screen.getByRole('table')
return screen
.getAllByRole('button', { name: 'Trash' })
.filter(button => !table.contains(button))[0]
}
function getSidebarProjectsFilterButton() {
return screen.getAllByRole('button', { name: 'Projects' })[0]
}
describe('<ProjectListRoot />', function () {
this.timeout('10s')
@@ -308,8 +321,7 @@ describe('<ProjectListRoot />', function () {
describe('trashed projects', function () {
beforeEach(function () {
const filterButton = screen.getAllByText('Trashed projects')[0]
fireEvent.click(filterButton)
fireEvent.click(getSidebarTrashButton())
allCheckboxes = screen.getAllByRole<HTMLInputElement>('checkbox')
// + 1 because of select all
@@ -326,15 +338,14 @@ describe('<ProjectListRoot />', function () {
})
it('shows the download, archive, and restore buttons in top toolbar', function () {
expect(screen.queryByLabelText('Trash')).to.be.null
expect(within(actionsToolbar).queryByLabelText('Trash')).to.be.null
within(actionsToolbar).queryByLabelText('Download')
within(actionsToolbar).queryByLabelText('Archive')
within(actionsToolbar).getByText('Restore') // no icon for this button
})
it('clears selected projects when filter changed', function () {
const filterButton = screen.getAllByText('All projects')[0]
fireEvent.click(filterButton)
fireEvent.click(getSidebarProjectsFilterButton())
const allCheckboxes =
screen.getAllByRole<HTMLInputElement>('checkbox')
@@ -641,7 +652,10 @@ describe('<ProjectListRoot />', function () {
expect(screen.queryByText(p.name)).to.be.null
})
const trashBtns = screen.getAllByRole('button', { name: 'Trash' })
const trashBtns = within(screen.getByRole('table')).getAllByRole(
'button',
{ name: 'Trash' }
)
for (const [index, trashBtn] of trashBtns.entries()) {
fireEvent.click(trashBtn)
fireEvent.click(
@@ -829,9 +843,7 @@ describe('<ProjectListRoot />', function () {
assertToolbarButtonsExists()
// select trashed projects
const [trashedProjectsButton] =
screen.getAllByText(/trashed projects/i)
fireEvent.click(trashedProjectsButton)
fireEvent.click(getSidebarTrashButton())
fireEvent.click(tag)
allCheckboxes = screen.getAllByRole('checkbox')
@@ -843,8 +855,7 @@ describe('<ProjectListRoot />', function () {
describe('"More" dropdown', function () {
beforeEach(async function () {
const filterButton = screen.getAllByText('All projects')[0]
fireEvent.click(filterButton)
fireEvent.click(getSidebarProjectsFilterButton())
allCheckboxes = screen.getAllByRole<HTMLInputElement>('checkbox')
})
@@ -41,9 +41,6 @@ describe('<SidebarDsNav />', function () {
global.localStorage.clear()
window.metaAttributesCache.set('ol-tags', [])
window.metaAttributesCache.set('ol-ExposedSettings', { isOverleaf: true })
window.metaAttributesCache.set('ol-splitTestVariants', {
'overleaf-library': 'enabled',
})
window.metaAttributesCache.set('ol-inactiveTutorials', [
'library-new-badge',
])