From 62c395677b3f46096657d6af1293cbea403414bc Mon Sep 17 00:00:00 2001 From: Corin Stratton Date: Mon, 14 Oct 2024 18:01:44 -0400 Subject: [PATCH] Prettier + unit test --- packages/lexical-table/src/LexicalTableNode.ts | 6 +++--- .../src/__tests__/unit/LexicalTableNode.test.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/lexical-table/src/LexicalTableNode.ts b/packages/lexical-table/src/LexicalTableNode.ts index fe542637919..32beaaba3f4 100644 --- a/packages/lexical-table/src/LexicalTableNode.ts +++ b/packages/lexical-table/src/LexicalTableNode.ts @@ -29,11 +29,11 @@ import { ElementNode, } from 'lexical'; +import {PIXEL_VALUE_REG_EXP} from './constants'; import {$isTableCellNode, TableCellNode} from './LexicalTableCellNode'; import {TableDOMCell, TableDOMTable} from './LexicalTableObserver'; import {TableRowNode} from './LexicalTableRowNode'; import {getTable} from './LexicalTableSelectionHelpers'; -import {PIXEL_VALUE_REG_EXP} from './constants' export type SerializedTableNode = Spread< { @@ -368,9 +368,9 @@ export function $convertTableElement( columns = undefined; break; } - columns.push(parseFloat(width)) + columns.push(parseFloat(width)); } - if (columns) tableNode.setColWidths(columns); + if (columns) {tableNode.setColWidths(columns);} } return {node: tableNode}; } diff --git a/packages/lexical-table/src/__tests__/unit/LexicalTableNode.test.tsx b/packages/lexical-table/src/__tests__/unit/LexicalTableNode.test.tsx index fb1d9af2332..570ac0e9ed2 100644 --- a/packages/lexical-table/src/__tests__/unit/LexicalTableNode.test.tsx +++ b/packages/lexical-table/src/__tests__/unit/LexicalTableNode.test.tsx @@ -114,7 +114,7 @@ describe('LexicalTableNode tests', () => { const dataTransfer = new DataTransferMock(); dataTransfer.setData( 'text/html', - '

Hello there

General Kenobi!

Lexical is nice


', + '

Hello there

General Kenobi!

Lexical is nice


', ); await editor.update(() => { const selection = $getSelection(); @@ -127,7 +127,7 @@ describe('LexicalTableNode tests', () => { // Make sure paragraph is inserted inside empty cells const emptyCell = '


'; expect(testEnv.innerHTML).toBe( - `${emptyCell}

Hello there

General Kenobi!

Lexical is nice

`, + `${emptyCell}

Hello there

General Kenobi!

Lexical is nice

`, ); });