Skip to content

Commit

Permalink
test(ui-themes): migrate old Themes tests
Browse files Browse the repository at this point in the history
Closes: INSTUI-3987
  • Loading branch information
git-nandor committed Feb 9, 2024
1 parent 2cfbb4f commit 2af9d6c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions packages/ui-themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
"license": "MIT",
"devDependencies": {
"@instructure/ui-babel-preset": "8.53.0",
"@instructure/ui-test-utils": "8.53.0",
"@instructure/ui-theme-tokens": "8.53.0"
"@instructure/ui-theme-tokens": "8.53.0",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "^14.0.0"
},
"dependencies": {
"@instructure/canvas-high-contrast-theme": "8.53.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/
import { canvas, canvasHighContrast, instructure } from '..'
import { expect } from '@instructure/ui-test-utils'
import '@testing-library/jest-dom'

const themes = [canvas, canvasHighContrast, instructure]

Expand All @@ -32,16 +32,19 @@ describe('themes are backwards compatible', () => {
it(`${theme.key}`, () => {
const brandColor = theme.variables.colors.brand

expect(brandColor).to.not.be.empty()
expect(brandColor).toBeDefined()
expect(brandColor).not.toBe('')
})
}
})

describe("should be able to access theme variables with 'theme.x'", () => {
for (const theme of themes) {
it(`${theme.key}`, () => {
const brandColor = theme.colors.brand

expect(brandColor).to.not.be.empty()
expect(brandColor).toBeDefined()
expect(brandColor).not.toBe('')
})
}
})
Expand Down
3 changes: 0 additions & 3 deletions packages/ui-themes/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
},
{
"path": "../ui-theme-tokens/tsconfig.build.json"
},
{
"path": "../ui-test-utils/tsconfig.build.json"
}
]
}

0 comments on commit 2af9d6c

Please sign in to comment.