Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7343051
D1577.id5208.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D1577.id5208.diff
View Options
diff --git a/cypress/integration/webapp.spec.js b/cypress/integration/webapp.spec.js
new file mode 100644
--- /dev/null
+++ b/cypress/integration/webapp.spec.js
@@ -0,0 +1,48 @@
+/**
+ * Copyright (C) 2019 The Software Heritage developers
+ * See the AUTHORS file at the top-level directory of this distribution
+ * License: GNU Affero General Public License version 3, or any later version
+ * See top-level LICENSE file for more information
+ */
+
+const url = '/'
+
+describe('Back-to-top button tests', function() {
+ beforeEach(function () {
+ cy.visit(url);
+ })
+
+ it('should be hidden when on top', function() {
+ cy.get('#back-to-top').should('not.be.visible');
+ })
+
+ it('should be visible when scrolled down', function() {
+ cy.scrollTo('bottom')
+ .get('#back-to-top')
+ .should('be.visible');
+ })
+
+ it('should scroll to top when clicked', function() {
+ cy.scrollTo('bottom')
+ .get('#back-to-top')
+ .click()
+ .window()
+ .then((window) => {
+ assert.equal(window.scrollY, 0);
+ })
+ })
+})
+
+describe('Sidebar tests', function() {
+ it('should toggle when swh-push-menu is clicked', function() {
+ cy.visit(url)
+ cy.get('.swh-push-menu')
+ .click()
+ .get('body')
+ .should('have.class', 'sidebar-collapse')
+ .get('.swh-push-menu')
+ .click()
+ .get('body')
+ .should('have.class', 'sidebar-open')
+ })
+})
\ No newline at end of file
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mar 17 2025, 6:58 PM (7 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3224512
Attached To
D1577: Add tests for sidebar, back-to-top
Event Timeline
Log In to Comment