@openmrs/esm-navigation
Advanced tools
Comparing version 6.0.1-pre.2568 to 6.0.1-pre.2569
{ | ||
"name": "@openmrs/esm-navigation", | ||
"version": "6.0.1-pre.2568", | ||
"version": "6.0.1-pre.2569", | ||
"license": "MPL-2.0", | ||
@@ -47,3 +47,3 @@ "description": "OpenMRS library providing tools for breadcrumbs, navigation, and history.", | ||
"devDependencies": { | ||
"@openmrs/esm-state": "6.0.1-pre.2568", | ||
"@openmrs/esm-state": "6.0.1-pre.2569", | ||
"lodash": "^4.17.21" | ||
@@ -50,0 +50,0 @@ }, |
@@ -35,2 +35,27 @@ import { interpolateString, interpolateUrl } from './interpolate-string'; | ||
}); | ||
it('handles multiple occurrences of the same parameter', () => { | ||
const result = interpolateString('${value} and ${value}', { value: 'test' }); | ||
expect(result).toBe('test and test'); | ||
}); | ||
it('handles empty string parameters', () => { | ||
const result = interpolateString('prefix${param}suffix', { param: '' }); | ||
expect(result).toBe('prefixsuffix'); | ||
}); | ||
it('leaves unreplaced parameters in template string', () => { | ||
const result = interpolateString('${exists} ${missing}', { exists: 'value' }); | ||
expect(result).toBe('value ${missing}'); | ||
}); | ||
it('removes double slashes at the start of URLs', () => { | ||
const result = interpolateUrl('${openmrsBase}/${path}', { path: 'test' }); | ||
expect(result).toBe('/openmrs/test'); | ||
}); | ||
it('handles special characters in parameters', () => { | ||
const result = interpolateString('${param}', { param: '${}' }); | ||
expect(result).toBe('${}'); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
133945
682