From e7e17a1ea74f0612219ddbe4650f976c5132ca23 Mon Sep 17 00:00:00 2001 From: Klaus Silveira Date: Tue, 9 Sep 2025 08:45:44 -0400 Subject: [PATCH] Added test to cover display of file contents, as well as proper raw output. --- tests/cypress/integration/files.spec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/cypress/integration/files.spec.js diff --git a/tests/cypress/integration/files.spec.js b/tests/cypress/integration/files.spec.js new file mode 100644 index 0000000..702afe8 --- /dev/null +++ b/tests/cypress/integration/files.spec.js @@ -0,0 +1,15 @@ +describe('File page', () => { + it('view file contents', () => { + cy.visit('/git-bare-repo/blob/HEAD/mm/cma.c'); + + cy.get('.breadcrumb > .active').should('have.text', '\n cma.c\n '); + cy.get('.ace_comment:nth(1)').should('have.text', ' * Contiguous Memory Allocator'); + }); + + it('view file raw', () => { + cy.request('/git-bare-repo/raw/HEAD/mm/cma.c').then((resp) => { + expect(resp.status).to.eq(200); + expect(resp.body).to.include(' * Contiguous Memory Allocator'); + }); + }); +});