{labels.map(label => (
diff --git a/services/web/frontend/stylesheets/app/editor/history-react.less b/services/web/frontend/stylesheets/app/editor/history-react.less
index b87d3ea9f0..4042f69e89 100644
--- a/services/web/frontend/stylesheets/app/editor/history-react.less
+++ b/services/web/frontend/stylesheets/app/editor/history-react.less
@@ -375,6 +375,15 @@ history-root {
}
}
+.history-dropdown-icon {
+ color: @neutral-90;
+}
+
+.history-compare-btn {
+ line-height: 1;
+ padding: 0;
+}
+
.history-file-tree {
display: flex !important; // To work around jQuery layout's inline styles
flex-direction: column;
diff --git a/services/web/locales/en.json b/services/web/locales/en.json
index 3109ab9b0f..7683f2b582 100644
--- a/services/web/locales/en.json
+++ b/services/web/locales/en.json
@@ -719,7 +719,6 @@
"history_adding_label": "Adding label",
"history_are_you_sure_delete_label": "Are you sure you want to delete the following label",
"history_compare_from_this_version": "Compare from this version",
- "history_compare_to_selected_version": "Compare to selected version",
"history_compare_up_to_this_version": "Compare up to this version",
"history_delete_label": "Delete label",
"history_deleting_label": "Deleting label",
diff --git a/services/web/test/frontend/features/history/components/change-list.spec.tsx b/services/web/test/frontend/features/history/components/change-list.spec.tsx
index 7e20e05a1a..82b17d2f87 100644
--- a/services/web/test/frontend/features/history/components/change-list.spec.tsx
+++ b/services/web/test/frontend/features/history/components/change-list.spec.tsx
@@ -332,14 +332,10 @@ describe('change list', function () {
cy.findAllByTestId('history-version-details')
.eq(1)
.within(() => {
- cy.findByRole('button', { name: /more actions/i }).click()
- cy.findByRole('menu').within(() => {
- cy.findByRole('menuitem', {
- name: /compare to selected version/i,
- }).click()
- })
+ cy.findByRole('button', {
+ name: /Compare/i,
+ }).click()
})
- cy.wait('@diff')
cy.findByLabelText(/all history/i).click({ force: true })
cy.findAllByTestId('history-version-details').should($versions => {
const [first, ...rest] = Array.from($versions)
@@ -350,6 +346,40 @@ describe('change list', function () {
})
})
+ describe('compare mode', function () {
+ beforeEach(function () {
+ mountWithEditorProviders(, scope, {
+ user: {
+ id: USER_ID,
+ email: USER_EMAIL,
+ isAdmin: true,
+ },
+ })
+ waitForData()
+ })
+
+ it('compares versions', function () {
+ cy.findAllByTestId('history-version-details').should($versions => {
+ const [first, ...rest] = Array.from($versions)
+ expect(first).to.have.attr('data-selected', 'true')
+ rest.forEach(version =>
+ expect(version).to.have.attr('data-selected', 'false')
+ )
+ })
+
+ cy.intercept('GET', '/project/*/filetree/diff*', {
+ body: { diff: [{ pathname: 'main.tex' }, { pathname: 'name.tex' }] },
+ }).as('compareDiff')
+
+ cy.findAllByTestId('history-version-details')
+ .last()
+ .within(() => {
+ cy.findByTestId('compare-icon-version').click()
+ })
+ cy.wait('@compareDiff')
+ })
+ })
+
describe('dropdown', function () {
beforeEach(function () {
mountWithEditorProviders(, scope, {
@@ -421,33 +451,6 @@ describe('change list', function () {
})
cy.wait('@download')
})
-
- it('compares versions', function () {
- cy.findAllByTestId('history-version-details').should($versions => {
- const [first, ...rest] = Array.from($versions)
- expect(first).to.have.attr('data-selected', 'true')
- rest.forEach(version =>
- expect(version).to.have.attr('data-selected', 'false')
- )
- })
-
- cy.intercept('GET', '/project/*/filetree/diff*', {
- body: { diff: [{ pathname: 'main.tex' }, { pathname: 'name.tex' }] },
- }).as('compareDiff')
-
- cy.findAllByTestId('history-version-details')
- .last()
- .within(() => {
- cy.findByRole('button', { name: /more actions/i }).click()
- cy.findByRole('menu').within(() => {
- cy.findByRole('menuitem', {
- name: /compare to selected version/i,
- }).click()
- })
- })
-
- cy.wait('@compareDiff')
- })
})
describe('paywall', function () {