-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GraphiQL component:
showThemeSettings
changeset change prop to enforceTheme clean change prop name cypress theme tests delete onEditForceTheme fix some new changeset fix fix Update packages/graphiql/cypress/e2e/theme.cy.ts Co-authored-by: Dimitri POSTOLOV <en3m@ya.ru> Update packages/graphiql/cypress/e2e/theme.cy.ts Co-authored-by: Dimitri POSTOLOV <en3m@ya.ru> Update packages/graphiql/cypress/e2e/theme.cy.ts Co-authored-by: Dimitri POSTOLOV <en3m@ya.ru> Update packages/graphiql/resources/renderExample.js Co-authored-by: Dimitri POSTOLOV <en3m@ya.ru> Update packages/graphiql/src/components/GraphiQL.tsx Co-authored-by: Dimitri POSTOLOV <en3m@ya.ru> Update packages/graphiql/src/components/GraphiQL.tsx Co-authored-by: Dimitri POSTOLOV <en3m@ya.ru> Update packages/graphiql/cypress/e2e/theme.cy.ts Co-authored-by: Dimitri POSTOLOV <en3m@ya.ru> Update .changeset/famous-shirts-mate.md Co-authored-by: Dimitri POSTOLOV <en3m@ya.ru> Update packages/graphiql/cypress/e2e/theme.cy.ts Co-authored-by: Dimitri POSTOLOV <en3m@ya.ru> Update packages/graphiql/cypress/e2e/theme.cy.ts Co-authored-by: Dimitri POSTOLOV <en3m@ya.ru> Update packages/graphiql/cypress/e2e/theme.cy.ts Co-authored-by: Dimitri POSTOLOV <en3m@ya.ru>
- Loading branch information
1 parent
3d4b9b7
commit 8f75b62
Showing
4 changed files
with
78 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'graphiql': minor | ||
--- | ||
|
||
Add a new prop to GraphiQL component: `forcedTheme` to force the theme and hide the theme switcher. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
describe('Theme', () => { | ||
it('Switches to light theme when forcedTheme is light', () => { | ||
cy.visit('/?query={test}&forcedTheme=light'); | ||
cy.get('body').should('have.class', 'graphiql-light'); | ||
}); | ||
|
||
it('Switches to dark theme when forcedTheme is dark', () => { | ||
cy.visit('/?query={test}&forcedTheme=dark'); | ||
cy.get('body').should('have.class', 'graphiql-dark'); | ||
}); | ||
|
||
it('Defaults to light theme when forcedTheme value is invalid', () => { | ||
cy.visit('/?query={test}&forcedTheme=invalid'); | ||
cy.get('body').should('have.class', 'graphiql-light'); | ||
cy.get('.graphiql-dialog-section-title').should('have.text', 'Theme'); // Check for the presence of the theme dialog | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters