Skip to content

Commit

Permalink
fix file test error
Browse files Browse the repository at this point in the history
  • Loading branch information
jabahum committed Jan 18, 2024
1 parent 0f1afe6 commit 373d35a
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 2 deletions.
9 changes: 9 additions & 0 deletions file-transformer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const path = require('path');

module.exports = {
process(sourceText, sourcePath, options) {
return {
code: `module.exports = ${JSON.stringify(path.basename(sourcePath))};`,
};
},
};
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const path = require('path');
module.exports = {
transform: {
'^.+\\.(j|t)sx?$': '@swc/jest',
'^.+\\.png$': path.resolve(__dirname, 'file-transformer.js'),
},
transformIgnorePatterns: ['/node_modules/(?!@openmrs)'],
moduleNameMapper: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"jest": "^28.1.0",
"jest-cli": "^28.1.0",
"jest-environment-jsdom": "^28.1.0",
"jest-transform-stub": "^2.0.0",
"lerna": "^3.20.2",
"openmrs": "next",
"prettier": "^2.4.1",
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable jsx-a11y/no-static-element-interactions */
import React from 'react';
import styles from './fingerprint-capture.scss';
import thumb96 from '../../../../assets/thumb-96.png';
import thumb96 from '../../../../assets/thumb.png';

interface ThumbPrintProps {
data: string;
Expand All @@ -10,7 +11,7 @@ interface ThumbPrintProps {

const ThumbPrint: React.FC<ThumbPrintProps> = ({ data, onClick, isActive }) => (
<div className={`${styles.centeredContainer} ${isActive ? styles.activeThumb : ''}`} onClick={() => onClick(data)}>
<img src={thumb96} alt={'photo'} className={styles.centeredImage} />
<img src={thumb96} alt={'thumb'} className={styles.centeredImage} />
{data && <p className={styles.centeredText}>Scan {data}</p>}
</div>
);
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5004,6 +5004,7 @@ __metadata:
jest: ^28.1.0
jest-cli: ^28.1.0
jest-environment-jsdom: ^28.1.0
jest-transform-stub: ^2.0.0
lerna: ^3.20.2
openmrs: next
prettier: ^2.4.1
Expand Down Expand Up @@ -12893,6 +12894,13 @@ __metadata:
languageName: node
linkType: hard

"jest-transform-stub@npm:^2.0.0":
version: 2.0.0
resolution: "jest-transform-stub@npm:2.0.0"
checksum: c46134257e5fb047f5952e4a4a1339925dd009da15aa8d3310ba1d3e4d22266ed6c675cd18e58c9d5ca2246718d6cc8ff00ea6a4b6f3b2a6b285b6426f6ae8fe
languageName: node
linkType: hard

"jest-util@npm:^28.1.3":
version: 28.1.3
resolution: "jest-util@npm:28.1.3"
Expand Down

0 comments on commit 373d35a

Please sign in to comment.