Skip to content

Commit

Permalink
Fix tests after semantic merge conflict (#11488)
Browse files Browse the repository at this point in the history
Force merging to repair CI.
  • Loading branch information
kazcw authored Nov 4, 2024
1 parent dd107e0 commit 42fc2af
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import {
useTableNewArgument,
} from '@/components/GraphEditor/widgets/WidgetTableEditor/tableNewArgument'
import { MenuItem } from '@/components/shared/AgGridTableView.vue'
import { WidgetInput, WidgetUpdate } from '@/providers/widgetRegistry'
import { WidgetInput } from '@/providers/widgetRegistry'
import { SuggestionDb } from '@/stores/suggestionDatabase'
import { makeType } from '@/stores/suggestionDatabase/entry'
import { assert } from '@/util/assert'
import { Ast } from '@/util/ast'
import { GetContextMenuItems, GetMainMenuItems } from 'ag-grid-enterprise'
import { expect, test, vi } from 'vitest'
import { assertDefined } from 'ydoc-shared/util/assert'

function suggestionDbWithNothing() {
const db = new SuggestionDb()
Expand All @@ -24,7 +25,9 @@ function suggestionDbWithNothing() {

function generateTableOfOnes(rows: number, cols: number) {
const code = `Table.new [${[...Array(cols).keys()].map((i) => `['Column #${i}', [${Array(rows).fill('1').join(',')}]]`).join(',')}]`
return Ast.parse(code)
const ast = Ast.parseExpression(code)
assertDefined(ast)
return ast
}

const expectedRowIndexColumnDef = { headerName: ROW_INDEX_HEADER }
Expand Down Expand Up @@ -88,7 +91,8 @@ test.each([
],
},
])('Read table from $code', ({ code, expectedColumnDefs, expectedRows }) => {
const ast = Ast.parseExpression(code)!
const ast = Ast.parseExpression(code)
assertDefined(ast)
expect(tableNewCallMayBeHandled(ast)).toBeTruthy()
const input = WidgetInput.FromAst(ast)
const startEdit = vi.fn()
Expand Down Expand Up @@ -177,7 +181,8 @@ test.each([
"Table.new [['a', [123]], ['a'.repeat 170, [123]]]",
"Table.new [['a', [1, 2, 3, 3 + 1]]]",
])('"%s" is not valid input for Table Editor Widget', (code) => {
const ast = Ast.parseExpression(code)!
const ast = Ast.parseExpression(code)
assertDefined(ast)
expect(tableNewCallMayBeHandled(ast)).toBeFalsy()
})

Expand Down

0 comments on commit 42fc2af

Please sign in to comment.