Skip to content

Commit f1682aa

Browse files
committed
fixed failing tests
1 parent acedb4a commit f1682aa

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = {
1515
},
1616
transformIgnorePatterns: ['node_modules/(?!arc)/(?!d3)'],
1717
moduleNameMapper: {
18+
'\\.svg\\?url$': '<rootDir>/testUtils/svgUrlTransform.js',
1819
'd3-hexbin': '<rootDir>/node_modules/d3-hexbin/build/d3-hexbin.min.js',
1920
d3: '<rootDir>/node_modules/d3/dist/d3.min.js',
2021
},

src/containers/AMMRankings/AMMRankingsTable.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,6 @@ const PoolDisplay: FC<{ amm: AMMPool }> = ({ amm }) => (
135135

136136
export const AMMRankingsTable: FC<AMMRankingsTableProps> = ({
137137
amms,
138-
sortField,
139-
setSortField,
140-
sortOrder,
141-
setSortOrder,
142138
currencyMode,
143139
}) => {
144140
const { t } = useTranslation()
@@ -157,7 +153,7 @@ export const AMMRankingsTable: FC<AMMRankingsTableProps> = ({
157153
className="hover"
158154
onMouseOver={(e) => {
159155
const rect = e.currentTarget.getBoundingClientRect()
160-
showTooltip('text', e, t(`${key}_tooltip`), {
156+
showTooltip('text', e, t(`${key}_tooltip` as any), {
161157
x: rect.left + rect.width / 2,
162158
y: rect.top - yOffset,
163159
})
@@ -177,7 +173,6 @@ export const AMMRankingsTable: FC<AMMRankingsTableProps> = ({
177173
if (filterField) {
178174
result = result.filter(
179175
(amm) =>
180-
amm.asset_class === filterField ||
181176
amm.asset_class_1 === filterField ||
182177
amm.asset_class_2 === filterField,
183178
)

src/containers/AMMRankings/GeneralInfoCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const GeneralInfoCard: FC<GeneralInfoCardProps> = ({
6868
className="hover"
6969
onMouseOver={(e) => {
7070
const rect = e.currentTarget.getBoundingClientRect()
71-
showTooltip('text', e, t(`${key}_tooltip`), {
71+
showTooltip('text', e, t(`${key}_tooltip` as any), {
7272
x: rect.left + rect.width / 2,
7373
y: rect.top - 60,
7474
})
@@ -117,7 +117,7 @@ export const GeneralInfoCard: FC<GeneralInfoCardProps> = ({
117117
</div>
118118

119119
<div className="stat-row">
120-
<div className="stat-label">{t('24h_volume')}</div>
120+
<div className="stat-label">{t('volume_24h' as any)}</div>
121121
<div className="stat-value">
122122
{volume24h ? formatCurrencyAmount(volume24h) : DEFAULT_EMPTY_VALUE}
123123
</div>

src/containers/AMMRankings/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export const AMMRankings: FC = () => {
148148
<TVLVolumeChart
149149
data={historicalData?.data_points || []}
150150
timeRange={timeRange}
151-
setTimeRange={setTimeRange}
151+
setTimeRange={(range: string) => setTimeRange(range as TimeRange)}
152152
showTVL={showTVL}
153153
showVolume={showVolume}
154154
currencyMode={currencyMode}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
declare module '*.svg?url' {
2+
const content: string
3+
export default content
4+
}
5+

testUtils/svgUrlTransform.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Mock module for SVG imports with ?url suffix
2+
// Returns a mock URL path for testing
3+
module.exports = '/mock-svg-url.svg'
4+

0 commit comments

Comments
 (0)