Skip to content

Commit

Permalink
[#2184] Fix Inconsistent Line Number Colours (#2185)
Browse files Browse the repository at this point in the history
Fix Inconsistent Line Number Colours

A regression has occurred where the line numbers no longer have a
consistent grey color.

Let's fix the bug and add a test to catch further regressions of the
same nature.
  • Loading branch information
sopa301 committed Apr 27, 2024
1 parent 02c7198 commit 553f3f2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions frontend/cypress/tests/codeView/codeView_codeHighlighting.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
// Assumes: RepoSense repo from 03/05/2018 to current date
describe('code highlighting works properly', () => {
it('line numbers should all have the same colour', () => {
cy.get('.icon-button.fa-code')
.should('exist')
.first()
.click();

cy.get('#tab-authorship .files', { timeout: 90000 })
.should('be.visible');

cy.get('.line-number') // this is just a wrapper
.first()
.children()
// The actual line number element. We can't name the class
// because it's generated by the code highlighter.
.first()
.should('have.css', 'color')
.then((firstColor) => {
cy.get('.line-number')
.each((el) => cy.wrap(el)
.children()
.first()
.should('have.css', 'color', firstColor));
});
});

it('should highlight code when there is a single author', () => {
// open the code panel
cy.get('.icon-button.fa-code')
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/c-segment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default defineComponent({
});
</script>

<style lang="scss" scoped>
<style lang="scss">
@import '../styles/hightlight-js-style.css';
@import '../styles/_colors.scss';
Expand Down

0 comments on commit 553f3f2

Please sign in to comment.