Skip to content

Commit

Permalink
PB-790: Fix unit test and remove old hack fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailsunni authored and pakb committed Aug 7, 2024
1 parent 4e905be commit 4bb3991
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
10 changes: 0 additions & 10 deletions src/api/print.api.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,6 @@ class GeoAdminCustomizer extends BaseCustomizer {
symbolizer.pointRadius = adjustWidth(symbolizer.pointRadius, this.printResolution)
symbolizer.strokeWidth = adjustWidth(symbolizer.strokeWidth, this.printResolution)
symbolizer.haloRadius = adjustWidth(symbolizer.haloRadius, this.printResolution)
// Ideally this should be done in the geoblocks/mapfishprint
// but it's quite complex to handle all the cases
try {
const fontFamily = symbolizer.fontFamily.split(' ')
symbolizer.fontWeight = fontFamily[0]
symbolizer.fontSize = parseInt(fontFamily[1])
symbolizer.fontFamily = fontFamily[2].toUpperCase()
} catch (error) {
// Keep the font family as it is
}
}

/**
Expand Down
8 changes: 4 additions & 4 deletions tests/cypress/tests-e2e/print.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,8 @@ describe('Testing print', () => {
const textSymbolAttributes = {
type: 'text',
label: 'Sample Label',
fontFamily: 'HELVETICA',
fontSize: 16,
fontFamily: 'Helvetica',
fontSize: '16px',
fontWeight: 'normal',
labelYOffset: 44.75,
}
Expand Down Expand Up @@ -557,8 +557,8 @@ describe('Testing print', () => {
const textSymbolAttributes = {
type: 'text',
label: 'Old Label',
fontFamily: 'HELVETICA',
fontSize: 16,
fontFamily: 'Helvetica',
fontSize: '16px',
fontWeight: 'normal',
labelYOffset: 0,
}
Expand Down

0 comments on commit 4bb3991

Please sign in to comment.