Skip to content

Commit 09fbc3f

Browse files
committed
jest tests pass with import css
1 parent 166ab0d commit 09fbc3f

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

jest.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ export default {
1111
'^.+\\.[tj]sx?$': ['babel-jest', { configFile: './babel.config.mjs' }],
1212
},
1313
transformIgnorePatterns: ['/node_modules/(?!lit-html).+\\.js'],
14+
moduleNameMapper: {
15+
'\\.css$': '<rootDir>/test/__mocks__/styleMock.js',
16+
},
1417
setupFilesAfterEnv: ['./test/helpers/setup.ts'],
1518
testMatch: ['**/?(*.)+(spec|test).[tj]s?(x)'],
1619
roots: ['<rootDir>/src', '<rootDir>/test'],

src/outline/manager.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ export default function (context) {
173173
const td = dom.createElement('td')
174174
td.classList.add('obj')
175175
td.setAttribute('notSelectable', 'false')
176+
td.style.margin = '0.2em'
177+
td.style.border = 'none'
178+
td.style.padding = '0'
179+
td.style.verticalAlign = 'top'
176180
const theClass = 'obj'
177181

178182
// set about and put 'expand' icon
@@ -196,7 +200,6 @@ export default function (context) {
196200
).addEventListener('click', expandMouseDownListener)
197201
}
198202
td.setAttribute('class', theClass) // this is how you find an object
199-
// @@ TAKE CSS OUT OF STYLE SHEET
200203
if (kb.whether(obj, UI.ns.rdf('type'), UI.ns.link('Request'))) {
201204
td.className = 'undetermined'
202205
} // @@? why-timbl

test/__mocks__/styleMock.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {};

0 commit comments

Comments
 (0)