Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quantum-kittens
GitHub Repository: quantum-kittens/platypus
Path: blob/main/cypress/integration/content.spec.js
3855 views
1
/// <reference types="cypress" />
2
3
const viewports = ['ipad-2', 'iphone-x', 'macbook-15']
4
5
describe('Content', () => {
6
it('text is readable', () => {
7
viewports.forEach((viewport) => {
8
const contentParagraphSelector = 'x-step p'
9
10
cy.viewport(viewport)
11
cy.visit('/course/ch-prerequisites')
12
cy.get(contentParagraphSelector).each(($paragraph) => {
13
if ($paragraph.text().trim().length > 0) {
14
cy.get($paragraph).scrollIntoView().should('be.visible')
15
16
cy.get($paragraph)
17
.invoke('css', 'font-size')
18
.then(parseInt)
19
.then((fontSize) => {
20
expect(fontSize).to.be.at.least(14)
21
})
22
}
23
})
24
})
25
})
26
})
27
28