Skip to content

Commit

Permalink
Set NODE_ENV to test for Jest in package.json and update webapp/src/t…
Browse files Browse the repository at this point in the history
…heme.ts
  • Loading branch information
Rajat-Dabade committed Nov 13, 2024
1 parent 5a4162a commit b8f4692
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"packdev": "cross-env NODE_ENV=dev webpack --config webpack.dev.js",
"watchdev": "cross-env NODE_ENV=dev webpack --watch --progress --config webpack.dev.js",
"deveditor": "cross-env NODE_ENV=dev webpack server --config webpack.editor.js",
"test": "jest",
"updatesnapshot": "jest --updateSnapshot",
"test": "NODE_ENV=test jest",
"updatesnapshot": "NODE_ENV=test jest --updateSnapshot",
"check": "eslint --ignore-pattern node_modules --ignore-pattern static --ignore-pattern dist --ext .js --ext .jsx --ext tsx --ext ts . --quiet --cache && stylelint **/*.scss",
"check-types": "tsc",
"fix": "eslint --ext .tsx,.ts . --quiet --fix --cache && stylelint --fix **/*.scss",
Expand Down
18 changes: 10 additions & 8 deletions webapp/src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,16 @@ export function setTheme(theme: Theme | null): Theme {

const style = document.documentElement.style

style.setProperty('--center-channel-bg-rgb', style.getPropertyValue('--center-channel-bg-rgb') || consolidatedTheme.mainBg)
style.setProperty('--center-channel-color-rgb', style.getPropertyValue('--center-channel-color-rgb') || consolidatedTheme.mainBg)
style.setProperty('--button-bg-rgb', style.getPropertyValue('--button-bg-rgb') || consolidatedTheme.mainBg)
style.setProperty('--button-color-rgb', style.getPropertyValue('--button-color-rgb') || consolidatedTheme.mainBg)
style.setProperty('--sidebar-bg-rgb', style.getPropertyValue('--sidebar-bg-rgb') || consolidatedTheme.mainBg)
style.setProperty('--sidebar-text-rgb', style.getPropertyValue('--sidebar-text-rgb') || consolidatedTheme.mainBg)
style.setProperty('--link-color-rgb', style.getPropertyValue('--link-color-rgb') || consolidatedTheme.mainBg)
style.setProperty('--sidebar-text-active-border-rgb', style.getPropertyValue('--sidebar-text-active-border-rgb') || consolidatedTheme.mainBg)
if (process.env.NODE_ENV === 'test') {
style.setProperty('--center-channel-bg-rgb', style.getPropertyValue('--center-channel-bg-rgb') || consolidatedTheme.mainBg)
style.setProperty('--center-channel-color-rgb', style.getPropertyValue('--center-channel-color-rgb') || consolidatedTheme.mainBg)
style.setProperty('--button-bg-rgb', style.getPropertyValue('--button-bg-rgb') || consolidatedTheme.mainBg)
style.setProperty('--button-color-rgb', style.getPropertyValue('--button-color-rgb') || consolidatedTheme.mainBg)
style.setProperty('--sidebar-bg-rgb', style.getPropertyValue('--sidebar-bg-rgb') || consolidatedTheme.mainBg)
style.setProperty('--sidebar-text-rgb', style.getPropertyValue('--sidebar-text-rgb') || consolidatedTheme.mainBg)
style.setProperty('--link-color-rgb', style.getPropertyValue('--link-color-rgb') || consolidatedTheme.mainBg)
style.setProperty('--sidebar-text-active-border-rgb', style.getPropertyValue('--sidebar-text-active-border-rgb') || consolidatedTheme.mainBg)
}

document.documentElement.style.setProperty('--sidebar-white-logo', consolidatedTheme.sidebarWhiteLogo)
document.documentElement.style.setProperty('--link-visited-color-rgb', consolidatedTheme.linkVisited)
Expand Down

0 comments on commit b8f4692

Please sign in to comment.