forked from MapComplete/MapComplete
refactoring: Fix some tests
This commit is contained in:
parent
bef05481bd
commit
ea62b5b7ff
4 changed files with 30 additions and 24 deletions
|
@ -83,13 +83,13 @@ export default class SpecialVisualizations {
|
|||
* Note that _normal_ substitutions are ignored.
|
||||
*
|
||||
* // Return empty list on empty input
|
||||
* SubstitutedTranslation.constructSpecification("") // => []
|
||||
* SpecialVisualizations.constructSpecification("") // => []
|
||||
*
|
||||
* // Advanced cases with commas, braces and newlines should be handled without problem
|
||||
* const templates = SubstitutedTranslation.constructSpecification("{send_email(&LBRACEemail&RBRACE,Broken bicycle pump,Hello&COMMA\n\nWith this email&COMMA I'd like to inform you that the bicycle pump located at https://mapcomplete.osm.be/cyclofix?lat=&LBRACE_lat&RBRACE&lon=&LBRACE_lon&RBRACE&z=18#&LBRACEid&RBRACE is broken.\n\n Kind regards,Report this bicycle pump as broken)}")
|
||||
* const templ = templates[0]
|
||||
* templ.special.func.funcName // => "send_email"
|
||||
* templ.special.args[0] = "{email}"
|
||||
* const templates = SpecialVisualizations.constructSpecification("{send_email(&LBRACEemail&RBRACE,Broken bicycle pump,Hello&COMMA\n\nWith this email&COMMA I'd like to inform you that the bicycle pump located at https://mapcomplete.osm.be/cyclofix?lat=&LBRACE_lat&RBRACE&lon=&LBRACE_lon&RBRACE&z=18#&LBRACEid&RBRACE is broken.\n\n Kind regards,Report this bicycle pump as broken)}")
|
||||
* const templ = <Exclude<RenderingSpecification, string>> templates[0]
|
||||
* templ.func.funcName // => "send_email"
|
||||
* templ.args[0] = "{email}"
|
||||
*/
|
||||
public static constructSpecification(
|
||||
template: string,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue