aboutsummaryrefslogtreecommitdiff
path: root/cypress
diff options
context:
space:
mode:
authorJess <[email protected]>2022-01-30 05:16:45 -0500
committerGitHub <[email protected]>2022-01-30 11:16:45 +0100
commitc9329425faef7d90135471e02aa2d083599bdb94 (patch)
tree14de54c7104763540a8f9c61171874ecc6d2a18e /cypress
parent9206e7aded60dd03b54b7dc6e9f8162753013b68 (diff)
downloadfaker-c9329425faef7d90135471e02aa2d083599bdb94.tar.xz
faker-c9329425faef7d90135471e02aa2d083599bdb94.zip
fix: removing toc to fix the docs html (#341)
Co-authored-by: Shinigami <[email protected]>
Diffstat (limited to 'cypress')
-rw-r--r--cypress/e2e/smoke.cy.ts25
1 files changed, 20 insertions, 5 deletions
diff --git a/cypress/e2e/smoke.cy.ts b/cypress/e2e/smoke.cy.ts
index 6b3bc06b..eb3cf1fb 100644
--- a/cypress/e2e/smoke.cy.ts
+++ b/cypress/e2e/smoke.cy.ts
@@ -1,11 +1,26 @@
describe('Smoke Test', () => {
- it('compiles the guide page', () => {
+ beforeEach(() => {
cy.visit('/guide/');
+ cy.get('a[href="/api/animal.html"]').as('firstSectionLink');
+ });
+
+ it('compiles the guide page', () => {
cy.contains('Getting Started');
});
- // it('compiles the playground page', () => {
- // cy.visit('/playground/');
- // cy.contains('Playground under construction');
- // });
+ it('renders this last code example in the code', () => {
+ // Click on any section in the sidebar
+ cy.get('@firstSectionLink')
+ .click()
+ // Make sure the number of code examples is the same between reloads
+ .get('.container pre code')
+ .then(($codeBlocks) => {
+ // Trigger a reload
+ cy.reload()
+ // Give the runtime a chance to update/fail
+ .wait(500)
+ .get('.container pre code')
+ .should('have.length', $codeBlocks.length);
+ });
+ });
});