diff --git a/.circleci/config.yml b/.circleci/config.yml index 89944475ba..ea7f42256b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -67,7 +67,7 @@ jobs: run-tests-in-parallel: executor: cypress/default - parallelism: 6 + parallelism: 2 steps: - attach_workspace: at: ~/ diff --git a/cypress.config.ts b/cypress.config.ts index 29b85f6ec8..ce486443e2 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -12,36 +12,41 @@ export default defineConfig({ supportFile: false, baseUrl: "http://localhost:3000", setupNodeEvents(on, config) { - on("task", { - "createFileTree"({ path }) { - // take the given path and create an array of all file paths - // with each files and the directory path of the file as strings - // for example: given 'accessibility' return - // ['accessibility/get-started/introduction', 'accessibility/core-concepts/how-it-works'] - path = 'docs/' + path; - - function walk(dir: string): string[] { - return readdirSync(dir, { withFileTypes: true }).flatMap((file) => { - if (file.name.includes('_category_.json') || file.name.includes('.DS_Store')) { - return [] - } - - if (file.name.includes('.mdx')) { - // remove the .mdx file extension - file.name = file.name.slice(0, -4) - } - - if (file.isDirectory()) { - return walk(join(dir, file.name)) - } else { - return [join(dir, file.name)] - } - }) + const path = 'docs'; + + function walk(dir: string): string[] { + return readdirSync(dir, { withFileTypes: true }).flatMap((file) => { + // ignore these irrelevant files with no content + if (file.name.includes('_category_.json') || file.name.includes('.DS_Store')) { + return [] + } + + if (file.name.includes('lodash')) { + // lodash file actually goes to _ URL + file.name = file.name.replace('lodash', '_') + } + + if (file.name.includes('.mdx')) { + // remove the .mdx file extension + file.name = file.name.slice(0, -4) } - return walk(path).filter((file) => file !== undefined).map((file) => file.slice(5)) - } - }) + if (file.isDirectory()) { + if(file.name === 'partials') { + return [] + } + return walk(join(dir, file.name)) + } else { + return [join(dir, file.name)] + } + }) } + + const URLs = walk(path).filter((file) => file !== undefined).map((file) => file.slice(5)) + + config.env.URLs = URLs + + return config }, -}); + }, +}) diff --git a/cypress/e2e/a11y_pages.cy.ts b/cypress/e2e/a11y_pages.cy.ts deleted file mode 100644 index 303f649c16..0000000000 --- a/cypress/e2e/a11y_pages.cy.ts +++ /dev/null @@ -1,16 +0,0 @@ -describe('Visit a11y pages', () => { - before(() => { - cy.task('createFileTree', { path: 'accessibility' }).then((urls) => { - // console.log('urlsLength', urls.length) - Cypress.env({ urls }) - }) - }) - - // Well, this number is hardcoded and should match the length of urls - Cypress._.range(0, 12).forEach(index => { - it(`Visit a11y page ${index} `, () => { - cy.visit(Cypress.env().urls[index]) - cy.get('h1').should('be.visible') - }) - }) -}) \ No newline at end of file diff --git a/cypress/e2e/all_pages.cy.ts b/cypress/e2e/all_pages.cy.ts new file mode 100644 index 0000000000..2b61844d0c --- /dev/null +++ b/cypress/e2e/all_pages.cy.ts @@ -0,0 +1,15 @@ +const URLs: Array = Cypress.env('URLs') + +// Mostly this is to get a UI Coverage and Accessibility report +describe('Visit all pages', () => { + URLs.forEach((URL) => { + it(`Visit ${URL} `, () => { + cy.visit(URL) + cy.get('h1') + .should('be.visible') + .and('not.have.text', 'Page Not Found') + + cy.get('[aria-label="Switch to dark mode"]').click() + }) + }) +}) \ No newline at end of file diff --git a/cypress/e2e/api_pages.cy.ts b/cypress/e2e/api_pages.cy.ts deleted file mode 100644 index 72dfef7116..0000000000 --- a/cypress/e2e/api_pages.cy.ts +++ /dev/null @@ -1,16 +0,0 @@ -describe('Visit API pages', () => { - before(() => { - cy.task('createFileTree', { path: 'api' }).then((urls) => { - // console.log('urlsLength', urls.length) - Cypress.env({ urls }) - }) - }) - - // Well, this number is hardcoded and should match the length of urls - Cypress._.range(0, 132).forEach(index => { - it(`Visit API page ${index} `, () => { - cy.visit(Cypress.env().urls[index]) - cy.get('h1').should('be.visible') - }) - }) -}) \ No newline at end of file diff --git a/cypress/e2e/app_pages.cy.ts b/cypress/e2e/app_pages.cy.ts deleted file mode 100644 index a0026f4ac9..0000000000 --- a/cypress/e2e/app_pages.cy.ts +++ /dev/null @@ -1,16 +0,0 @@ -describe('Visit App pages', () => { - before(() => { - cy.task('createFileTree', { path: 'app' }).then((urls) => { - console.log('urlsLength', urls.length) - Cypress.env({ urls }) - }) - }) - - // Well, this number is hardcoded and should match the length of urls - Cypress._.range(0, 81).forEach(index => { - it(`Visit App page ${index} `, () => { - cy.visit(Cypress.env().urls[index]) - cy.get('h1').should('be.visible') - }) - }) -}) \ No newline at end of file diff --git a/cypress/e2e/basic_tests.cy.ts b/cypress/e2e/basic_tests.cy.ts index 71f9e21c0c..5461fe9798 100644 --- a/cypress/e2e/basic_tests.cy.ts +++ b/cypress/e2e/basic_tests.cy.ts @@ -49,9 +49,11 @@ describe('Basic tests', () => { describe('Dark mode', () => { it('switch to dark mode when clicked', () => { - cy.get('[data-theme=light]').should('have.css', 'background-color', 'rgb(255, 255, 255)') // white + cy.get('[data-theme=light]') + .should('have.css', 'background-color', 'rgb(255, 255, 255)') // white cy.get('[aria-label="Switch to dark mode"]').click() - cy.get('[data-theme=dark]').should('have.css', 'background-color', 'rgb(27, 30, 46)') // dark gray + cy.get('[data-theme=dark]') + .should('have.css', 'background-color', 'rgb(27, 30, 46)') // dark gray }) }) @@ -61,4 +63,14 @@ describe('Basic tests', () => { cy.get('.DocSearch-Modal').should('be.visible') }) }) -}) \ No newline at end of file + + describe('404', () => { + it('displays 404 page', () => { + cy.visit('/foo/bar/baz') + cy.get('h1') + .should('be.visible') + .and('have.text', 'Page Not Found') + }) + }) +}) + diff --git a/cypress/e2e/cloud_pages.cy.ts b/cypress/e2e/cloud_pages.cy.ts deleted file mode 100644 index 21d3ced782..0000000000 --- a/cypress/e2e/cloud_pages.cy.ts +++ /dev/null @@ -1,16 +0,0 @@ -describe('Visit Cloud pages', () => { - before(() => { - cy.task('createFileTree', { path: 'cloud' }).then((urls) => { - // console.log('urlsLength', urls.length) - Cypress.env({ urls }) - }) - }) - - // Well, this number is hardcoded and should match the length of urls - Cypress._.range(0, 29).forEach(index => { - it(`Visit Cloud page ${index} `, () => { - cy.visit(Cypress.env().urls[index]) - cy.get('h1').should('be.visible') - }) - }) -}) \ No newline at end of file diff --git a/cypress/e2e/ui_cov_pages.cy.ts b/cypress/e2e/ui_cov_pages.cy.ts deleted file mode 100644 index 089713117f..0000000000 --- a/cypress/e2e/ui_cov_pages.cy.ts +++ /dev/null @@ -1,16 +0,0 @@ -describe('Visit UI Cov pages', () => { - before(() => { - cy.task('createFileTree', { path: 'ui-coverage' }).then((urls) => { - console.log('urlsLength', urls.length) - Cypress.env({ urls }) - }) - }) - - // Well, this number is hardcoded and should match the length of urls - Cypress._.range(0, 16).forEach(index => { - it(`Visit UI Cov page ${index} `, () => { - cy.visit(Cypress.env().urls[index]) - cy.get('h1').should('be.visible') - }) - }) -}) \ No newline at end of file diff --git a/src/components/badge/style.module.css b/src/components/badge/style.module.css index 807f9118b4..edad24be91 100644 --- a/src/components/badge/style.module.css +++ b/src/components/badge/style.module.css @@ -20,10 +20,6 @@ h1 > .badge { .success { background-color: var(--ifm-color-jade-100); color: var(--ifm-color-jade-600); - - [data-theme='dark'] & { - background-color: var(--ifm-color-jade-1000); - } } .danger { diff --git a/src/css/custom.scss b/src/css/custom.scss index 1065244568..4d7e524909 100644 --- a/src/css/custom.scss +++ b/src/css/custom.scss @@ -523,7 +523,6 @@ body ul.guidesList li.card { display: block; height: 100%; padding: 20px 30px; - // border-bottom: none; border-radius: 4px; border-width: 1px; border-color: transparent; @@ -539,6 +538,10 @@ body ul.guidesList li.card { color: var(--ifm-color-jade-400); height: 26px; width: 26px; + + html[data-theme='dark'] & { + color: var(--ifm-color-jade-300); + } } } @@ -547,10 +550,18 @@ body ul.guidesList li.card { font-size: 1.2rem; color: var(--ifm-color-indigo-500); background-size: 0 2px; + + html[data-theme='dark'] & { + color: var(--ifm-color-indigo-50); + } } p { margin-bottom: 0.5em; color: var(--ifm-color-gray-800); + + html[data-theme='dark'] & { + color: var(--ifm-color-gray-50); + } } } \ No newline at end of file diff --git a/src/css/markdown.scss b/src/css/markdown.scss index 5324d62941..1fbf59d681 100644 --- a/src/css/markdown.scss +++ b/src/css/markdown.scss @@ -66,8 +66,11 @@ div.markdown { display: inline-block; margin-bottom: 2rem; - &.text-white:hover { - color: white; + &.border-indigo-500 { + html[data-theme='dark'] & { + color: var(--ifm-color-jade-100); + border-color:var(--ifm-color-jade-100); + } } &.border-indigo-500:hover { @@ -78,7 +81,16 @@ div.markdown { } } - + &.text-white { + html[data-theme='dark'] & { + color: white; + border-color: white; + } + } + + &.text-white:hover { + color: white; + } svg { display: inline;