mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-30 14:55:27 -04:00
Fix renderer type test (#1647)
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
abceb356db
commit
a96b06c95b
6 changed files with 40 additions and 16 deletions
|
@ -31,3 +31,22 @@ export const cypressId = (
|
|||
return { 'data-cypress-id': attributeContent }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an object with an attribute that starts with "data-cypress-" and the given attribute name.
|
||||
* It is used to check additional data during integration tests.
|
||||
* This works only if the runtime is built in test mode.
|
||||
*
|
||||
* @param attribute The attribute name
|
||||
* @param value The attribute content
|
||||
* @return An object if in test mode, undefined otherwise.
|
||||
*/
|
||||
export const cypressAttribute = (attribute: string, value: string): Record<string, string> | undefined => {
|
||||
if (!isTestMode()) {
|
||||
return
|
||||
}
|
||||
|
||||
return {
|
||||
[`data-cypress-${attribute}`]: value
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue