2020-11-22 15:50:07 -05:00
|
|
|
/*
|
2021-01-06 15:37:59 -05:00
|
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
2020-11-22 15:50:07 -05:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2020-07-16 05:22:53 -04:00
|
|
|
import '../support/index'
|
|
|
|
|
|
|
|
describe('Links Intro', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.visit('/')
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('Cover Buttons', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.logout()
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Sign in Cover Button', () => {
|
|
|
|
cy.get('.cover-button.btn-success')
|
|
|
|
.click()
|
|
|
|
cy.url()
|
|
|
|
.should('include', '/login')
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Features Cover Button', () => {
|
|
|
|
cy.get('.cover-button.btn-primary')
|
|
|
|
.click()
|
|
|
|
cy.url()
|
|
|
|
.should('include', '/features')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
it('History', () => {
|
|
|
|
cy.get('#navLinkHistory')
|
|
|
|
.click()
|
|
|
|
cy.url()
|
|
|
|
.should('include', '/history')
|
|
|
|
cy.get('#navLinkIntro')
|
|
|
|
.click()
|
|
|
|
cy.url()
|
|
|
|
.should('include', '/intro')
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('Menu Buttons logged out', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.logout()
|
|
|
|
})
|
|
|
|
|
|
|
|
it('New guest note', () => {
|
|
|
|
cy.get('.d-inline-flex.btn-primary')
|
|
|
|
.click()
|
|
|
|
cy.url()
|
|
|
|
.should('include', '/new')
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Sign In', () => {
|
|
|
|
cy.get('.btn-success.btn-sm')
|
|
|
|
.click()
|
|
|
|
cy.url()
|
|
|
|
.should('include', '/login')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('Menu Buttons logged in', () => {
|
|
|
|
it('New note', () => {
|
2021-02-03 16:13:04 -05:00
|
|
|
cy.get('.d-inline-flex.btn-primary')
|
|
|
|
.click()
|
2020-07-16 05:22:53 -04:00
|
|
|
cy.url()
|
|
|
|
.should('include', '/new')
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('User Menu', () => {
|
|
|
|
beforeEach(() => {
|
2021-02-03 16:13:04 -05:00
|
|
|
cy.get('#dropdown-user')
|
|
|
|
.click()
|
2020-07-16 05:22:53 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
it('Features', () => {
|
|
|
|
cy.get('a.dropdown-item > i.fa-bolt')
|
|
|
|
.click()
|
|
|
|
cy.url()
|
|
|
|
.should('include', '/features')
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Features', () => {
|
|
|
|
cy.get('a.dropdown-item > i.fa-user')
|
|
|
|
.click()
|
|
|
|
cy.url()
|
|
|
|
.should('include', '/profile')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('Feature Links', () => {
|
|
|
|
it('Share-Notes', () => {
|
2021-02-08 09:03:11 -05:00
|
|
|
cy.get('i.fa-bolt')
|
2020-07-16 05:22:53 -04:00
|
|
|
.click()
|
|
|
|
cy.url()
|
|
|
|
.should('include', '/features#Share-Notes')
|
|
|
|
})
|
|
|
|
|
2020-08-27 09:13:35 -04:00
|
|
|
it('KaTeX', () => {
|
2021-02-08 09:03:11 -05:00
|
|
|
cy.get('i.fa-bar-chart')
|
2020-07-16 05:22:53 -04:00
|
|
|
.click()
|
|
|
|
cy.url()
|
|
|
|
.should('include', '/features#MathJax')
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Slide-Mode', () => {
|
2021-02-08 09:03:11 -05:00
|
|
|
cy.get('i.fa-television')
|
2020-07-16 05:22:53 -04:00
|
|
|
.click()
|
|
|
|
cy.url()
|
|
|
|
.should('include', '/features#Slide-Mode')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('Powered By Links', () => {
|
2020-09-02 15:17:26 -04:00
|
|
|
it('HedgeDoc', () => {
|
2020-12-22 11:27:26 -05:00
|
|
|
cy.get('a[href="https://hedgedoc.org"]')
|
|
|
|
.checkExternalLink('https://hedgedoc.org')
|
2020-07-16 05:22:53 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
it('Releases', () => {
|
|
|
|
cy.get('a[href*="/n/release-notes"]')
|
|
|
|
.click()
|
|
|
|
cy.url()
|
|
|
|
.should('include', '/n/release-notes')
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Privacy', () => {
|
|
|
|
cy.get('a[href="https://example.com/privacy"]')
|
|
|
|
.checkExternalLink('https://example.com/privacy')
|
|
|
|
})
|
|
|
|
|
|
|
|
it('TermsOfUse', () => {
|
|
|
|
cy.get('a[href="https://example.com/termsOfUse"]')
|
|
|
|
.checkExternalLink('https://example.com/termsOfUse')
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Imprint', () => {
|
|
|
|
cy.get('a[href="https://example.com/imprint"]')
|
|
|
|
.checkExternalLink('https://example.com/imprint')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('Follow us Links', () => {
|
|
|
|
it('Github', () => {
|
2020-12-22 11:27:26 -05:00
|
|
|
cy.get('a[href="https://github.com/hedgedoc/"]')
|
|
|
|
.checkExternalLink('https://github.com/hedgedoc/')
|
2020-07-16 05:22:53 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
it('Discourse', () => {
|
2020-12-22 11:27:26 -05:00
|
|
|
cy.get('a[href="https://community.hedgedoc.org"]')
|
|
|
|
.checkExternalLink('https://community.hedgedoc.org')
|
2020-07-16 05:22:53 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
it('Matrix', () => {
|
2020-09-30 12:19:17 -04:00
|
|
|
cy.get('a[href="https://matrix.to/#/#hedgedoc:matrix.org"]')
|
|
|
|
.checkExternalLink('https://matrix.to/#/#hedgedoc:matrix.org')
|
2020-07-16 05:22:53 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
it('Mastodon', () => {
|
2020-12-22 11:27:26 -05:00
|
|
|
cy.get('a[href="https://social.hedgedoc.org"]')
|
|
|
|
.checkExternalLink('https://social.hedgedoc.org')
|
2020-07-16 05:22:53 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
it('POEditor', () => {
|
2020-12-22 11:27:26 -05:00
|
|
|
cy.get('a[href="https://translate.hedgedoc.org"]')
|
|
|
|
.checkExternalLink('https://translate.hedgedoc.org')
|
2020-07-16 05:22:53 -04:00
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|