chore: Use ?? instead of ||

This commit is contained in:
Sidharth Vinod
2024-06-30 11:09:47 +05:30
parent d4525331cb
commit 7534462966
16 changed files with 50 additions and 53 deletions

View File

@@ -54,11 +54,11 @@ export const imgSnapshotTest = (
): void => {
const options: CypressMermaidConfig = {
..._options,
fontFamily: _options.fontFamily || 'courier',
fontFamily: _options.fontFamily ?? 'courier',
// @ts-ignore TODO: Fix type of fontSize
fontSize: _options.fontSize || '16px',
fontSize: _options.fontSize ?? '16px',
sequence: {
...(_options.sequence || {}),
...(_options.sequence ?? {}),
actorFontFamily: 'courier',
noteFontFamily: _options.sequence?.noteFontFamily
? _options.sequence.noteFontFamily
@@ -94,7 +94,7 @@ export const openURLAndVerifyRendering = (
options: CypressMermaidConfig,
validation?: any
): void => {
const name: string = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
const name: string = (options.name ?? cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
cy.visit(url);
cy.window().should('have.property', 'rendered', true);