Update e2e test code with new syntax
This commit is contained in:
		
				
					committed by
					
						 Nick Cameron
						Nick Cameron
					
				
			
			
				
	
			
			
			
						parent
						
							8e343a254f
						
					
				
				
					commit
					1227b38e12
				
			| @ -23,7 +23,7 @@ test.describe('Code pane and errors', () => { | ||||
|     |> line(end = [10, 0]) | ||||
|     |> line(end = [-5, 10]) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|   extrude001 = extrude(sketch001, length = 5)` | ||||
|       ) | ||||
|     }) | ||||
|  | ||||
| @ -17,7 +17,7 @@ test.describe('Command bar tests', () => { | ||||
|   |> line(end = [20, 0]) | ||||
|   |> line(end = [0, 20]) | ||||
|   |> xLine(-20, %) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|     ` | ||||
|       ) | ||||
|     }) | ||||
| @ -32,7 +32,7 @@ test.describe('Command bar tests', () => { | ||||
|     await u.closeDebugPanel() | ||||
|  | ||||
|     // Click the line of code for xLine. | ||||
|     await page.getByText(`close(%)`).click() // TODO remove this and reinstate // await topHorzSegmentClick() | ||||
|     await page.getByText(`close()`).click() // TODO remove this and reinstate // await topHorzSegmentClick() | ||||
|     await page.waitForTimeout(100) | ||||
|  | ||||
|     await page.getByRole('button', { name: 'Extrude' }).click() | ||||
| @ -69,7 +69,7 @@ test.describe('Command bar tests', () => { | ||||
|     await u.expectCmdLog('[data-message-type="execution-done"]') | ||||
|     await u.closeDebugPanel() | ||||
|  | ||||
|     const selectSegment = () => page.getByText(`line([0, -10], %)`).click() | ||||
|     const selectSegment = () => page.getByText(`line(end = [0, -10])`).click() | ||||
|  | ||||
|     await selectSegment() | ||||
|     await page.waitForTimeout(100) | ||||
| @ -226,7 +226,7 @@ test.describe('Command bar tests', () => { | ||||
|     |> line(end = [25.1, 0.41]) | ||||
|     |> line(end = [0.73, -20.93]) | ||||
|     |> line(end = [-23.44, 0.52]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|         ` | ||||
|       ) | ||||
|     }) | ||||
|  | ||||
| @ -20,7 +20,7 @@ test.describe('Copilot ghost text', () => { | ||||
|     await page.keyboard.press('Enter') | ||||
|     await expect(page.locator('.cm-ghostText').first()).toBeVisible() | ||||
|     await expect(page.locator('.cm-content')).toHaveText( | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)` | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)` | ||||
|     ) | ||||
|     await expect(page.locator('.cm-ghostText').first()).toHaveText( | ||||
|       `fn cube = (pos, scale) => {` | ||||
| @ -29,7 +29,7 @@ test.describe('Copilot ghost text', () => { | ||||
|     // We should be able to hit Tab to accept the completion. | ||||
|     await page.keyboard.press('Tab') | ||||
|     await expect(page.locator('.cm-content')).toHaveText( | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)` | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)` | ||||
|     ) | ||||
|  | ||||
|     // Hit enter a few times. | ||||
| @ -37,7 +37,7 @@ test.describe('Copilot ghost text', () => { | ||||
|     await page.keyboard.press('Enter') | ||||
|  | ||||
|     await expect(page.locator('.cm-content')).toHaveText( | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)    ` | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)    ` | ||||
|     ) | ||||
|  | ||||
|     await expect(page.locator('.cm-ghostText')).not.toBeVisible() | ||||
| @ -80,7 +80,7 @@ test.describe('Copilot ghost text', () => { | ||||
|     await page.keyboard.press('Enter') | ||||
|  | ||||
|     await expect(page.locator('.cm-content')).toHaveText( | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)` | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)` | ||||
|     ) | ||||
|     await expect(page.locator('.cm-ghostText').first()).toHaveText( | ||||
|       `fn cube = (pos, scale) => {` | ||||
| @ -89,7 +89,7 @@ test.describe('Copilot ghost text', () => { | ||||
|     // We should be able to hit Tab to accept the completion. | ||||
|     await page.keyboard.press('Tab') | ||||
|     await expect(page.locator('.cm-content')).toContainText( | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)` | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)` | ||||
|     ) | ||||
|   }) | ||||
|  | ||||
| @ -156,7 +156,7 @@ test.describe('Copilot ghost text', () => { | ||||
|     await page.keyboard.press('Enter') | ||||
|  | ||||
|     await expect(page.locator('.cm-content')).toHaveText( | ||||
|       `sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)` | ||||
|       `sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)` | ||||
|     ) | ||||
|     await expect(page.locator('.cm-ghostText').first()).toHaveText( | ||||
|       `fn cube = (pos, scale) => {` | ||||
| @ -165,7 +165,7 @@ test.describe('Copilot ghost text', () => { | ||||
|     // We should be able to hit Tab to accept the completion. | ||||
|     await page.keyboard.press('Tab') | ||||
|     await expect(page.locator('.cm-content')).toHaveText( | ||||
|       `sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)` | ||||
|       `sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)` | ||||
|     ) | ||||
|  | ||||
|     // Hit enter a few times. | ||||
| @ -173,7 +173,7 @@ test.describe('Copilot ghost text', () => { | ||||
|     await page.keyboard.press('Enter') | ||||
|  | ||||
|     await expect(page.locator('.cm-content')).toHaveText( | ||||
|       `sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)    ` | ||||
|       `sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)    ` | ||||
|     ) | ||||
|  | ||||
|     await expect(page.locator('.cm-ghostText')).not.toBeVisible() | ||||
| @ -194,7 +194,7 @@ test.describe('Copilot ghost text', () => { | ||||
|     await page.keyboard.press('Enter') | ||||
|     await expect(page.locator('.cm-ghostText').first()).toBeVisible() | ||||
|     await expect(page.locator('.cm-content')).toHaveText( | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)` | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)` | ||||
|     ) | ||||
|     await expect(page.locator('.cm-ghostText').first()).toHaveText( | ||||
|       `fn cube = (pos, scale) => {` | ||||
| @ -225,7 +225,7 @@ test.describe('Copilot ghost text', () => { | ||||
|     await page.keyboard.press('Enter') | ||||
|     await expect(page.locator('.cm-ghostText').first()).toBeVisible() | ||||
|     await expect(page.locator('.cm-content')).toHaveText( | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)` | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)` | ||||
|     ) | ||||
|     await expect(page.locator('.cm-ghostText').first()).toHaveText( | ||||
|       `fn cube = (pos, scale) => {` | ||||
| @ -256,7 +256,7 @@ test.describe('Copilot ghost text', () => { | ||||
|     await page.keyboard.press('Enter') | ||||
|     await expect(page.locator('.cm-ghostText').first()).toBeVisible() | ||||
|     await expect(page.locator('.cm-content')).toHaveText( | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)` | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)` | ||||
|     ) | ||||
|     await expect(page.locator('.cm-ghostText').first()).toHaveText( | ||||
|       `fn cube = (pos, scale) => {` | ||||
| @ -287,7 +287,7 @@ test.describe('Copilot ghost text', () => { | ||||
|     await page.keyboard.press('Enter') | ||||
|     await expect(page.locator('.cm-ghostText').first()).toBeVisible() | ||||
|     await expect(page.locator('.cm-content')).toHaveText( | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)` | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)` | ||||
|     ) | ||||
|     await expect(page.locator('.cm-ghostText').first()).toHaveText( | ||||
|       `fn cube = (pos, scale) => {` | ||||
| @ -315,7 +315,7 @@ test.describe('Copilot ghost text', () => { | ||||
|     await page.keyboard.press('Enter') | ||||
|     await expect(page.locator('.cm-ghostText').first()).toBeVisible() | ||||
|     await expect(page.locator('.cm-content')).toHaveText( | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)` | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)` | ||||
|     ) | ||||
|     await expect(page.locator('.cm-ghostText').first()).toHaveText( | ||||
|       `fn cube = (pos, scale) => {` | ||||
| @ -326,7 +326,7 @@ test.describe('Copilot ghost text', () => { | ||||
|     await expect(page.locator('.cm-ghostText').first()).toBeVisible() | ||||
|  | ||||
|     await expect(page.locator('.cm-content')).toHaveText( | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)` | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)` | ||||
|     ) | ||||
|   }) | ||||
|  | ||||
| @ -348,7 +348,7 @@ test.describe('Copilot ghost text', () => { | ||||
|     await page.keyboard.press('Enter') | ||||
|     await expect(page.locator('.cm-ghostText').first()).toBeVisible() | ||||
|     await expect(page.locator('.cm-content')).toHaveText( | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)` | ||||
|       `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)` | ||||
|     ) | ||||
|     await expect(page.locator('.cm-ghostText').first()).toHaveText( | ||||
|       `fn cube = (pos, scale) => {` | ||||
| @ -409,7 +409,7 @@ test.describe('Copilot ghost text', () => { | ||||
|     await page.keyboard.press('Enter') | ||||
|     await expect(page.locator('.cm-ghostText').first()).toBeVisible() | ||||
|     await expect(page.locator('.cm-content')).toHaveText( | ||||
|       `{thing: "blah"}fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)` | ||||
|       `{thing: "blah"}fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)` | ||||
|     ) | ||||
|     await expect(page.locator('.cm-ghostText').first()).toHaveText( | ||||
|       `fn cube = (pos, scale) => {` | ||||
| @ -450,7 +450,7 @@ test.describe('Copilot ghost text', () => { | ||||
|       await page.keyboard.press('Enter') | ||||
|       await expect(page.locator('.cm-ghostText').first()).toBeVisible() | ||||
|       await expect(page.locator('.cm-content')).toHaveText( | ||||
|         `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)` | ||||
|         `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)` | ||||
|       ) | ||||
|       await expect(page.locator('.cm-ghostText').first()).toHaveText( | ||||
|         `fn cube = (pos, scale) => {` | ||||
| @ -483,7 +483,7 @@ test.describe('Copilot ghost text', () => { | ||||
|       await page.keyboard.press('Enter') | ||||
|       await expect(page.locator('.cm-ghostText').first()).toBeVisible() | ||||
|       await expect(page.locator('.cm-content')).toHaveText( | ||||
|         `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)` | ||||
|         `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)` | ||||
|       ) | ||||
|       await expect(page.locator('.cm-ghostText').first()).toHaveText( | ||||
|         `fn cube = (pos, scale) => {` | ||||
| @ -514,7 +514,7 @@ test.describe('Copilot ghost text', () => { | ||||
|       await page.keyboard.press('Enter') | ||||
|       await expect(page.locator('.cm-ghostText').first()).toBeVisible() | ||||
|       await expect(page.locator('.cm-content')).toHaveText( | ||||
|         `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close(%)    |> extrude(length = 20)` | ||||
|         `fn cube = (pos, scale) => {  sg = startSketchOn('XY')    |> startProfileAt(pos, %)    |> line(end = [0, scale], %)    |> line(end = [scale, 0])    |> line([0, -scale])  return sg}part001 = cube([0,0], 20)    |> close()    |> extrude(length = 20)` | ||||
|       ) | ||||
|       await expect(page.locator('.cm-ghostText').first()).toHaveText( | ||||
|         `fn cube = (pos, scale) => {` | ||||
|  | ||||
| @ -26,7 +26,7 @@ test.describe('Editor tests', () => { | ||||
|     |> line(end = [20, 0]) | ||||
|     |> line(end = [0, 20]) | ||||
|     |> line(end = [-20, 0]) | ||||
|     |> close(%)`) | ||||
|     |> close()`) | ||||
|  | ||||
|     await page.keyboard.down('ControlOrMeta') | ||||
|     await page.keyboard.press('/') | ||||
| @ -38,7 +38,7 @@ test.describe('Editor tests', () => { | ||||
|   |> line(end = [20, 0]) | ||||
|   |> line(end = [0, 20]) | ||||
|   |> line(end = [-20, 0]) | ||||
|   // |> close(%)`) | ||||
|   // |> close()`) | ||||
|  | ||||
|     // uncomment the code | ||||
|     await page.keyboard.down('ControlOrMeta') | ||||
| @ -51,7 +51,7 @@ test.describe('Editor tests', () => { | ||||
|   |> line(end = [20, 0]) | ||||
|   |> line(end = [0, 20]) | ||||
|   |> line(end = [-20, 0]) | ||||
|   |> close(%)`) | ||||
|   |> close()`) | ||||
|   }) | ||||
|  | ||||
|   test('ensure we use the cache, and do not re-execute', async ({ | ||||
| @ -70,7 +70,7 @@ test.describe('Editor tests', () => { | ||||
|   |> line(end = [20, 0]) | ||||
|   |> line(end = [0, 20]) | ||||
|   |> line(end = [-20, 0]) | ||||
|   |> close(%)`) | ||||
|   |> close()`) | ||||
|  | ||||
|     // Ensure we execute the first time. | ||||
|     await u.openDebugPanel() | ||||
| @ -119,7 +119,7 @@ test.describe('Editor tests', () => { | ||||
|   |> line(end = [20, 0]) | ||||
|   |> line(end = [0, 20]) | ||||
|   |> line(end = [-20, 0]) | ||||
|   |> close(%)`) | ||||
|   |> close()`) | ||||
|  | ||||
|     // Ensure we execute the first time. | ||||
|     await u.openDebugPanel() | ||||
| @ -174,7 +174,7 @@ test.describe('Editor tests', () => { | ||||
|     |> line(end = [20, 0]) | ||||
|     |> line(end = [0, 20]) | ||||
|     |> line(end = [-20, 0]) | ||||
|     |> close(%)`) | ||||
|     |> close()`) | ||||
|     await page.locator('#code-pane button:first-child').click() | ||||
|     await page.locator('button:has-text("Format code")').click() | ||||
|  | ||||
| @ -184,7 +184,7 @@ test.describe('Editor tests', () => { | ||||
|   |> line(end = [20, 0]) | ||||
|   |> line(end = [0, 20]) | ||||
|   |> line(end = [-20, 0]) | ||||
|   |> close(%)`) | ||||
|   |> close()`) | ||||
|   }) | ||||
|  | ||||
|   test('if you click the format button it formats your code and executes so lints are still there', async ({ | ||||
| @ -205,7 +205,7 @@ test.describe('Editor tests', () => { | ||||
|     |> line(end = [20, 0]) | ||||
|     |> line(end = [0, 20]) | ||||
|     |> line(end = [-20, 0]) | ||||
|     |> close(%)`) | ||||
|     |> close()`) | ||||
|  | ||||
|     await u.openDebugPanel() | ||||
|     await u.expectCmdLog('[data-message-type="execution-done"]') | ||||
| @ -233,7 +233,7 @@ test.describe('Editor tests', () => { | ||||
|   |> line(end = [20, 0]) | ||||
|   |> line(end = [0, 20]) | ||||
|   |> line(end = [-20, 0]) | ||||
|   |> close(%)`) | ||||
|   |> close()`) | ||||
|  | ||||
|     // error in guter | ||||
|     await expect(page.locator('.cm-lint-marker-info').first()).toBeVisible() | ||||
| @ -251,7 +251,7 @@ test.describe('Editor tests', () => { | ||||
|    |> line(end = [20, 0]) | ||||
|    |> line(end = [0, 20]) | ||||
|    |> line(end = [-20, 0]) | ||||
|    |> close(%)` | ||||
|    |> close()` | ||||
|     await page.addInitScript(async () => { | ||||
|       localStorage.setItem( | ||||
|         'persistCode', | ||||
| @ -260,7 +260,7 @@ test.describe('Editor tests', () => { | ||||
|    |> line(end = [20, 0]) | ||||
|    |> line(end = [0, 20]) | ||||
|    |> line(end = [-20, 0]) | ||||
|    |> close(%)` | ||||
|    |> close()` | ||||
|       ) | ||||
|     }) | ||||
|     await page.setBodyDimensions({ width: 1000, height: 500 }) | ||||
| @ -329,7 +329,7 @@ test.describe('Editor tests', () => { | ||||
|     |> line(end = [20, 0]) | ||||
|     |> line(end = [0, 20]) | ||||
|     |> line(end = [-20, 0]) | ||||
|     |> close(%)` | ||||
|     |> close()` | ||||
|       ) | ||||
|     }) | ||||
|     await page.setBodyDimensions({ width: 1000, height: 500 }) | ||||
| @ -374,7 +374,7 @@ test.describe('Editor tests', () => { | ||||
|     |> line(end = [20, 0]) | ||||
|     |> line(end = [0, 20]) | ||||
|     |> line(end = [-20, 0]) | ||||
|     |> close(%)` | ||||
|     |> close()` | ||||
|       ) | ||||
|       localStorage.setItem('disableAxis', 'true') | ||||
|     }) | ||||
| @ -401,7 +401,7 @@ test.describe('Editor tests', () => { | ||||
|   |> line(end = [20, 0]) | ||||
|   |> line(end = [0, 20]) | ||||
|   |> line(end = [-20, 0]) | ||||
|   |> close(%)`) | ||||
|   |> close()`) | ||||
|   }) | ||||
|  | ||||
|   test('if you use the format keyboard binding it formats your code and executes so lints are shown', async ({ | ||||
| @ -417,7 +417,7 @@ test.describe('Editor tests', () => { | ||||
|     |> line(end = [20, 0]) | ||||
|     |> line(end = [0, 20]) | ||||
|     |> line(end = [-20, 0]) | ||||
|     |> close(%)` | ||||
|     |> close()` | ||||
|       ) | ||||
|       localStorage.setItem('disableAxis', 'true') | ||||
|     }) | ||||
| @ -454,7 +454,7 @@ test.describe('Editor tests', () => { | ||||
|   |> line(end = [20, 0]) | ||||
|   |> line(end = [0, 20]) | ||||
|   |> line(end = [-20, 0]) | ||||
|   |> close(%)`) | ||||
|   |> close()`) | ||||
|  | ||||
|     // error in guter | ||||
|     await expect(page.locator('.cm-lint-marker-info').first()).toBeVisible() | ||||
| @ -521,7 +521,7 @@ test.describe('Editor tests', () => { | ||||
|     |> startProfileAt([3.29, 7.86], %) | ||||
|     |> line(end = [2.48, 2.44]) | ||||
|     |> line(end = [2.66, 1.17]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|     ` | ||||
|       ) | ||||
|     }) | ||||
| @ -646,7 +646,7 @@ test.describe('Editor tests', () => { | ||||
|   |> line(endAbsolute = [width / 2, -length / 2]) | ||||
|   |> line(endAbsolute = [width / 2, length / 2]) | ||||
|   |> line(endAbsolute = [-width / 2, length / 2]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   return squareHoleSketch | ||||
|     } | ||||
|     ` | ||||
| @ -710,7 +710,7 @@ test.describe('Editor tests', () => { | ||||
|     |> line(end = [0, 10]) | ||||
|     |> line(end = [10, 0]) | ||||
|     |> line(end = [0, -10], tag = $revolveAxis) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|     |> extrude(length = 10) | ||||
|    | ||||
|     sketch001 = startSketchOn(box, revolveAxis) | ||||
| @ -718,7 +718,7 @@ test.describe('Editor tests', () => { | ||||
|     |> line(end = [0, -10]) | ||||
|     |> line(end = [2, 0]) | ||||
|     |> line(end = [0, -10]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|     |> revolve({ | ||||
|     axis: revolveAxis, | ||||
|     angle: 90 | ||||
| @ -901,7 +901,7 @@ test.describe('Editor tests', () => { | ||||
|   |> startProfileAt([4.61, -14.01], %) | ||||
|   |> line(end = [12.73, -0.09]) | ||||
|   |> tangentialArcTo([24.95, -5.38], %) | ||||
|   |> close(%)` | ||||
|   |> close()` | ||||
|       ) | ||||
|     }) | ||||
|  | ||||
| @ -949,7 +949,7 @@ test.describe('Editor tests', () => { | ||||
|  | ||||
|     // expect the code to have changed | ||||
|     await expect(page.locator('.cm-content')).toHaveText( | ||||
|       `sketch001 = startSketchOn('XZ')  |> startProfileAt([4.61, -14.01], %)  |> line(end = [12.73, -0.09], %)  |> tangentialArcTo([24.95, -5.38])  |> close(%)extrude001 = extrude(sketch001, length = 5)` | ||||
|       `sketch001 = startSketchOn('XZ')  |> startProfileAt([4.61, -14.01], %)  |> line(end = [12.73, -0.09], %)  |> tangentialArcTo([24.95, -5.38])  |> close()extrude001 = extrude(sketch001, length = 5)` | ||||
|     ) | ||||
|  | ||||
|     // Now hit undo | ||||
| @ -963,7 +963,7 @@ test.describe('Editor tests', () => { | ||||
|   |> startProfileAt([4.61, -14.01], %) | ||||
|   |> line(end = [12.73, -0.09]) | ||||
|   |> tangentialArcTo([24.95, -5.38], %) | ||||
|   |> close(%)`) | ||||
|   |> close()`) | ||||
|   }) | ||||
|  | ||||
|   test('Can undo a sketch modification with ctrl+z', async ({ | ||||
| @ -978,7 +978,7 @@ test.describe('Editor tests', () => { | ||||
|   |> startProfileAt([4.61, -10.01], %) | ||||
|   |> line(end = [12.73, -0.09]) | ||||
|   |> tangentialArcTo([24.95, -0.38], %) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> extrude(length = 5)` | ||||
|       ) | ||||
|     }) | ||||
| @ -1069,7 +1069,7 @@ test.describe('Editor tests', () => { | ||||
|     |> startProfileAt([2.71, -2.71], %) | ||||
|     |> line(end = [15.4, -2.78]) | ||||
|     |> tangentialArcTo([27.6, -3.05], %) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|     |> extrude(length = 5) | ||||
|   `) | ||||
|  | ||||
| @ -1083,7 +1083,7 @@ test.describe('Editor tests', () => { | ||||
|     |> startProfileAt([2.71, -2.71], %) | ||||
|     |> line(end = [15.4, -2.78]) | ||||
|     |> tangentialArcTo([24.95, -0.38], %) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|     |> extrude(length = 5)`) | ||||
|  | ||||
|     // Hit undo again. | ||||
| @ -1096,7 +1096,7 @@ test.describe('Editor tests', () => { | ||||
|     |> startProfileAt([2.71, -2.71], %) | ||||
|     |> line(end = [12.73, -0.09]) | ||||
|     |> tangentialArcTo([24.95, -0.38], %) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|     |> extrude(length = 5) | ||||
|   `) | ||||
|  | ||||
| @ -1111,7 +1111,7 @@ test.describe('Editor tests', () => { | ||||
|   |> startProfileAt([4.61, -10.01], %) | ||||
|   |> line(end = [12.73, -0.09]) | ||||
|   |> tangentialArcTo([24.95, -0.38], %) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> extrude(length = 5)`) | ||||
|   }) | ||||
|  | ||||
|  | ||||
| @ -11,7 +11,7 @@ export fn triangle() { | ||||
|     |> xLine(10, %) | ||||
|     |> line(end = [-10, -5]) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
| } | ||||
|  | ||||
| length001 = timesFive(1) * 5 | ||||
| @ -20,7 +20,7 @@ sketch001 = startSketchOn('XZ') | ||||
|   |> line(end = [10, 10]) | ||||
|   |> angledLine([-45, length001], %) | ||||
|   |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
| revolve001 = revolve({ axis = "X" }, sketch001) | ||||
| triangle() | ||||
|   |> extrude(length = 30) | ||||
| @ -31,7 +31,7 @@ sketch002 = startSketchOn(plane001) | ||||
|   |> xLine(-10, %) | ||||
|   |> line(endAbsolute = [-40, 0]) | ||||
|   |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
| extrude001 = extrude(sketch002, length = 10) | ||||
| ` | ||||
|  | ||||
|  | ||||
| @ -229,7 +229,7 @@ test.describe('verify sketch on chamfer works', () => { | ||||
|          -segLen(rectangleSegmentA002) | ||||
|        ], %, $rectangleSegmentC001) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%)`, | ||||
|     |> close()`, | ||||
|     }) | ||||
|  | ||||
|     await sketchOnAChamfer({ | ||||
| @ -260,7 +260,7 @@ test.describe('verify sketch on chamfer works', () => { | ||||
|          -segLen(rectangleSegmentA003) | ||||
|        ], %, $rectangleSegmentC002) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%)`, | ||||
|     |> close()`, | ||||
|     }) | ||||
|     await sketchOnAChamfer({ | ||||
|       clickCoords: { x: 677, y: 87 }, | ||||
| @ -285,7 +285,7 @@ test.describe('verify sketch on chamfer works', () => { | ||||
|          -segLen(rectangleSegmentA003) | ||||
|        ], %, $rectangleSegmentC002) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%)`, | ||||
|     |> close()`, | ||||
|     }) | ||||
|     /// last one | ||||
|     await sketchOnAChamfer({ | ||||
| @ -309,7 +309,7 @@ test.describe('verify sketch on chamfer works', () => { | ||||
|          -segLen(rectangleSegmentA005) | ||||
|        ], %, $rectangleSegmentC004) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%)`, | ||||
|     |> close()`, | ||||
|     }) | ||||
|  | ||||
|     await test.step('verify at the end of the test that final code is what is expected', async () => { | ||||
| @ -327,7 +327,7 @@ test.describe('verify sketch on chamfer works', () => { | ||||
|            -segLen(rectangleSegmentA001) | ||||
|          ], %, $yo) | ||||
|       |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02) | ||||
|       |> close(%) | ||||
|       |> close() | ||||
|     extrude001 = extrude(sketch001, length = 100) | ||||
|       |> chamfer({ | ||||
|            length = 30, | ||||
| @ -354,7 +354,7 @@ test.describe('verify sketch on chamfer works', () => { | ||||
|            -segLen(rectangleSegmentA005) | ||||
|          ], %, $rectangleSegmentC004) | ||||
|       |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|       |> close(%) | ||||
|       |> close() | ||||
|     sketch004 = startSketchOn(extrude001, seg05) | ||||
|       |> startProfileAt([82.57,322.96], %) | ||||
|       |> angledLine([0, 11.16], %, $rectangleSegmentA004) | ||||
| @ -367,7 +367,7 @@ test.describe('verify sketch on chamfer works', () => { | ||||
|            -segLen(rectangleSegmentA004) | ||||
|          ], %, $rectangleSegmentC003) | ||||
|       |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|       |> close(%) | ||||
|       |> close() | ||||
|     sketch003 = startSketchOn(extrude001, seg04) | ||||
|       |> startProfileAt([-209.64,255.28], %) | ||||
|       |> angledLine([0, 11.56], %, $rectangleSegmentA003) | ||||
| @ -380,7 +380,7 @@ test.describe('verify sketch on chamfer works', () => { | ||||
|            -segLen(rectangleSegmentA003) | ||||
|          ], %, $rectangleSegmentC002) | ||||
|       |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|       |> close(%) | ||||
|       |> close() | ||||
|     sketch002 = startSketchOn(extrude001, seg03) | ||||
|       |> startProfileAt([205.96,254.59], %) | ||||
|       |> angledLine([0, 11.39], %, $rectangleSegmentA002) | ||||
| @ -393,7 +393,7 @@ test.describe('verify sketch on chamfer works', () => { | ||||
|            -segLen(rectangleSegmentA002) | ||||
|          ], %, $rectangleSegmentC001) | ||||
|       |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|       |> close(%) | ||||
|       |> close() | ||||
|     `, | ||||
|         { shouldNormalise: true } | ||||
|       ) | ||||
| @ -448,7 +448,7 @@ test.describe('verify sketch on chamfer works', () => { | ||||
|          -segLen(rectangleSegmentA002) | ||||
|        ], %, $rectangleSegmentC001) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%)`, | ||||
|     |> close()`, | ||||
|     }) | ||||
|     await editor.expectEditor.toContain( | ||||
|       `sketch001 = startSketchOn('XZ') | ||||
| @ -463,7 +463,7 @@ test.describe('verify sketch on chamfer works', () => { | ||||
|        -segLen(rectangleSegmentA001) | ||||
|      ], %, $yo) | ||||
|   |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
| extrude001 = extrude(sketch001, length = 100) | ||||
| chamf = chamfer({ | ||||
|        length = 30, | ||||
| @ -489,7 +489,7 @@ sketch002 = startSketchOn(extrude001, seg03) | ||||
|        -segLen(rectangleSegmentA002) | ||||
|      ], %, $rectangleSegmentC001) | ||||
|   |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
| `, | ||||
|       { shouldNormalise: true } | ||||
|     ) | ||||
| @ -1095,11 +1095,11 @@ test(`Fillet point-and-click`, async ({ | ||||
|   // Code samples | ||||
|   const initialCode = `sketch001 = startSketchOn('XY') | ||||
|   |> startProfileAt([-12, -6], %) | ||||
|   |> line([0, 12], %) | ||||
|   |> line([24, 0], %) | ||||
|   |> line([0, -12], %) | ||||
|   |> line(end = [0, 12]) | ||||
|   |> line(end = [24, 0]) | ||||
|   |> line(end = [0, -12]) | ||||
|   |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
| extrude001 = extrude(-12, sketch001) | ||||
| ` | ||||
|   const firstFilletDeclaration = 'fillet({ radius = 5, tags = [seg01] }, %)' | ||||
| @ -1314,7 +1314,7 @@ test(`Chamfer point-and-click`, async ({ | ||||
|   |> line(end = [24, 0]) | ||||
|   |> line(end = [0, -12]) | ||||
|   |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
| extrude001 = extrude(sketch001, length = -12) | ||||
| ` | ||||
|   const firstChamferDeclaration = 'chamfer({ length = 5, tags = [seg01] }, %)' | ||||
| @ -1628,7 +1628,7 @@ test('Shell point-and-click wall', async ({ | ||||
|   |> yLine(-60, %) | ||||
|   |> xLine(-40, %) | ||||
|   |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
| extrude001 = extrude(sketch001, length = 40) | ||||
|   ` | ||||
|   await context.addInitScript((initialCode) => { | ||||
|  | ||||
| @ -1465,7 +1465,7 @@ test.fixme( | ||||
|   |> line(end = [118.328, -291.754]) | ||||
|   |> line(end = [-180.04, -202.08]) | ||||
|   |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
| extrude001 = extrude(sketch001, length = 200)`) | ||||
|     await page.waitForTimeout(800) | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ profile001 = startProfileAt([57.81, 250.51], sketch001) | ||||
|   |> line(end = [19.66, -116.4]) | ||||
|   |> line(end = [-221.8, -41.69]) | ||||
|   |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
| extrude001 = extrude(profile001, length = 200) | ||||
| sketch002 = startSketchOn('XZ') | ||||
|   |> startProfileAt([-73.64, -42.89], %) | ||||
| @ -17,7 +17,7 @@ sketch002 = startSketchOn('XZ') | ||||
|   |> line(end = [-22.12, -94.4]) | ||||
|   |> xLine(-156.98, %) | ||||
|   |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
| extrude002 = extrude(sketch002, length = 50) | ||||
| sketch003 = startSketchOn('XY') | ||||
|   |> startProfileAt([52.92, 157.81], %) | ||||
| @ -31,7 +31,7 @@ sketch003 = startSketchOn('XY') | ||||
|        -segLen(rectangleSegmentA001) | ||||
|      ], %, $rectangleSegmentC001) | ||||
|   |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
| extrude003 = extrude(sketch003, length = 20) | ||||
| ` | ||||
|  | ||||
|  | ||||
| @ -24,7 +24,7 @@ test.describe('Regression tests', () => { | ||||
|     |> line(end = [0, 0]) | ||||
|     |> line(end = [-4.84, -5.29]) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%)` | ||||
|     |> close()` | ||||
|       ) | ||||
|     }) | ||||
|  | ||||
| @ -68,7 +68,7 @@ test.describe('Regression tests', () => { | ||||
|        -segLen(rectangleSegmentA001) | ||||
|      ], %, $rectangleSegmentC001) | ||||
|   |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
| extrude001 = extrude(sketch001, length = 50) | ||||
| ` | ||||
|       ) | ||||
| @ -190,7 +190,7 @@ extrude001 = extrude(sketch001, length = 50) | ||||
|   |> line(end = [0, 1]) | ||||
|   |> line(end = [1, 0]) | ||||
|   |> line(end = [0, -1]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> extrude(length = 1) | ||||
|   |> patternLinear3d({ | ||||
|         axis: [1, 0, 1], | ||||
| @ -255,7 +255,7 @@ extrude001 = extrude(sketch001, length = 50) | ||||
|       |> startProfileAt([0, 0], %) | ||||
|       |> angledLine({ angle: 50, length: 45 }, %) | ||||
|       |> yLineTo(0, %) | ||||
|       |> close(%) | ||||
|       |> close() | ||||
|       |> | ||||
|    | ||||
|     example = extrude(exampleSketch, length = 5) | ||||
| @ -311,7 +311,7 @@ extrude001 = extrude(sketch001, length = 50) | ||||
|       |> startProfileAt([0, 0], %) | ||||
|       |> angledLine({ angle: 50, length: 45 }, %) | ||||
|       |> yLineTo(0, %) | ||||
|       |> close(%) | ||||
|       |> close() | ||||
|    | ||||
|       thing: "blah"`) | ||||
|  | ||||
|  | ||||
| @ -48,7 +48,7 @@ test.describe('Sketch tests', () => { | ||||
|   |> xLine(width * .5, %) | ||||
|   |> yLine(height, %) | ||||
|   |> xLine(-width * .5, %) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> hole(screwHole, %) | ||||
|   |> extrude(length = thickness) | ||||
|    | ||||
| @ -65,7 +65,7 @@ test.describe('Sketch tests', () => { | ||||
|       }, %) | ||||
|   |> yLine(-wireOffset, %) | ||||
|   |> xLine(-width / 4, %) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> extrude(length = -height) | ||||
|     ` | ||||
|         ) | ||||
| @ -190,7 +190,7 @@ test.describe('Sketch tests', () => { | ||||
|       |> startProfileAt([4.61, -14.01], %) | ||||
|       |> line(end = [12.73, -0.09]) | ||||
|       |> tangentialArcTo([24.95, -5.38], %) | ||||
|       |> close(%)` | ||||
|       |> close()` | ||||
|         ) | ||||
|       }) | ||||
|  | ||||
| @ -230,7 +230,7 @@ test.describe('Sketch tests', () => { | ||||
|       |> startProfileAt([4.61, -14.01], %) | ||||
|       |> line(end = [12.73, -0.09]) | ||||
|       |> tangentialArcTo([24.95, -5.38], %) | ||||
|       |> close(%)`) | ||||
|       |> close()`) | ||||
|       } else { | ||||
|         // Ensure we don't see the code. | ||||
|         await expect(u.codeLocator).not.toBeVisible() | ||||
| @ -308,7 +308,7 @@ test.describe('Sketch tests', () => { | ||||
|       |> line(end = [14.72, 1.97]) | ||||
|       |> tangentialArcTo([24.95, -5.38], %) | ||||
|       |> line(end = [1.97, 2.06]) | ||||
|       |> close(%)`) | ||||
|       |> close()`) | ||||
|     } | ||||
|     test('code pane open at start-handles', async ({ page, homePage }) => { | ||||
|       // Load the app with the code panes | ||||
| @ -441,7 +441,7 @@ test.describe('Sketch tests', () => { | ||||
|   |> startProfileAt([4.61, -10.01], %) | ||||
|   |> line(end = [12.73, -0.09]) | ||||
|   |> tangentialArcTo([24.95, -0.38], %) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> extrude(length = 5)` | ||||
|       ) | ||||
|     }) | ||||
| @ -527,7 +527,7 @@ test.describe('Sketch tests', () => { | ||||
|     |> startProfileAt([7.12, -12.68], %) | ||||
|     |> line(end = [12.68, -1.09]) | ||||
|     |> tangentialArcTo([24.89, 0.68], %) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|     |> extrude(length = 5) | ||||
|   `) | ||||
|   }) | ||||
| @ -544,7 +544,7 @@ test.describe('Sketch tests', () => { | ||||
|   |> startProfileAt([4.61, -14.01], %) | ||||
|   |> line(end = [12.73, -0.09]) | ||||
|   |> tangentialArcTo([24.95, -5.38], %) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> revolve({ axis = "X",}, %)` | ||||
|       ) | ||||
|     }) | ||||
| @ -630,7 +630,7 @@ test.describe('Sketch tests', () => { | ||||
|   |> line(end = [14.72, 1.97]) | ||||
|   |> tangentialArcTo([24.95, -5.38], %) | ||||
|   |> line(end = [1.97, 2.06]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> revolve({ axis = "X" }, %)`) | ||||
|   }) | ||||
|   test('Can add multiple sketches', async ({ page, homePage }) => { | ||||
| @ -745,7 +745,7 @@ test.describe('Sketch tests', () => { | ||||
|     |> xLine(${roundOff(scale * 139.19)}, %) | ||||
|     |> yLine(-${roundOff(scale * 139.2)}, %) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%)` | ||||
|     |> close()` | ||||
|  | ||||
|       await expect( | ||||
|         page.getByRole('button', { name: 'Start Sketch' }) | ||||
| @ -845,7 +845,7 @@ test.describe('Sketch tests', () => { | ||||
|     |> line(end = [1.02, -1.32], tag = $seg01) | ||||
|     |> line(end = [-1.01, -0.77]) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   ` | ||||
|       ) | ||||
|     }) | ||||
| @ -860,8 +860,8 @@ test.describe('Sketch tests', () => { | ||||
|     await u.expectCmdLog('[data-message-type="execution-done"]') | ||||
|     await u.closeDebugPanel() | ||||
|  | ||||
|     // click "line([1.32, 0.38], %)" | ||||
|     await page.getByText(`line([1.32, 0.38], %)`).click() | ||||
|     // click "line(end = [1.32, 0.38])" | ||||
|     await page.getByText(`line(end = [1.32, 0.38])`).click() | ||||
|     await page.waitForTimeout(100) | ||||
|     await expect(page.getByRole('button', { name: 'Edit Sketch' })).toBeEnabled( | ||||
|       { timeout: 10_000 } | ||||
| @ -903,7 +903,7 @@ test.describe('Sketch tests', () => { | ||||
|     |> line(end = [1.02, -1.32], tag = $seg01) | ||||
|     |> line(end = [-1.01, -0.77]) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|   extrude001 = extrude(sketch001, length = 5) | ||||
|   ` | ||||
|       ) | ||||
| @ -943,7 +943,7 @@ test.describe('Sketch tests', () => { | ||||
|     |> line(end = [1.02, -1.32], tag = $seg01) | ||||
|     |> line(end = [-1.01, -0.77]) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|   extrude001 = extrude(sketch001, length = 5) | ||||
|   sketch002 = startSketchOn(extrude001, 'END') | ||||
|     |> | ||||
| @ -1070,7 +1070,7 @@ test.describe('Sketch tests', () => { | ||||
|           |> angledLineOfYLength({ angle = 60, length = lugHeadLength }, %) | ||||
|           |> xLineTo(0 + .001, %) | ||||
|           |> yLineTo(0, %) | ||||
|           |> close(%) | ||||
|           |> close() | ||||
|           |> revolve({ axis = "Y" }, %) | ||||
|    | ||||
|         return lugSketch | ||||
| @ -1162,7 +1162,7 @@ test.describe('Sketch tests', () => { | ||||
|      -railTop / 2, | ||||
|      railClampable + railBaseLength | ||||
|    ]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|     |> extrude(length = in2mm(2))` | ||||
|       ) | ||||
|     }) | ||||
|  | ||||
| @ -105,7 +105,7 @@ part001 = startSketchOn('-XZ') | ||||
|       }, %) | ||||
|   |> angledLineToY([segAng(seg02, %) + 180, -baseHeight], %) | ||||
|   |> xLineTo(ZERO, %) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> extrude(length = 4)` | ||||
|       ) | ||||
|     }) | ||||
| @ -344,7 +344,7 @@ const extrudeDefaultPlane = async (context: any, page: any, plane: string) => { | ||||
|   |> line(end = [2.80, 5.00]) | ||||
|   |> line(end = [-5.60, 4.40]) | ||||
|   |> line(end = [-5.40, -3.80]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> extrude(length = 10.00) | ||||
| ` | ||||
|   await page.addInitScript(async (code: string) => { | ||||
| @ -816,13 +816,13 @@ test( | ||||
|   |> startProfileAt([1.4, 2.47], %) | ||||
|   |> line(end = [9.31, 10.55], tag = $seg01) | ||||
|   |> line(end = [11.91, -10.42]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> extrude(length = ${KCL_DEFAULT_LENGTH}) | ||||
| part002 = startSketchOn(part001, seg01) | ||||
|   |> startProfileAt([8, 8], %) | ||||
|   |> line(end = [4.68, 3.05]) | ||||
|   |> line(end = [0, -7.79]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> extrude(length = ${KCL_DEFAULT_LENGTH}) | ||||
| ` | ||||
|       ) | ||||
| @ -882,7 +882,7 @@ test( | ||||
|   |> line(end = [20, 0]) | ||||
|   |> line(end = [0, 20]) | ||||
|   |> line(end = [-20, 0]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
| ` | ||||
|       ) | ||||
|     }, KCL_DEFAULT_LENGTH) | ||||
| @ -925,7 +925,7 @@ test( | ||||
|   |> line(end = [20, 0]) | ||||
|   |> line(end = [0, 20]) | ||||
|   |> line(end = [-20, 0]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> extrude(length = 10) | ||||
| ` | ||||
|       ) | ||||
| @ -1114,7 +1114,7 @@ test.fixme('theme persists', async ({ page, context }) => { | ||||
|   |> line(end = [20, 0]) | ||||
|   |> line(end = [0, 20]) | ||||
|   |> line(end = [-20, 0]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> extrude(length = 10) | ||||
| ` | ||||
|     ) | ||||
|  | ||||
| @ -92,7 +92,7 @@ export const TEST_CODE_GIZMO = `part001 = startSketchOn('XZ') | ||||
|   offset: 0 | ||||
| }, %) | ||||
| |> tangentialArcTo([13.14 + 0, 13.14], %) | ||||
| |> close(%) | ||||
| |> close() | ||||
| |> extrude(length = 5 + 7) | ||||
| ` | ||||
|  | ||||
| @ -106,7 +106,7 @@ keychain = startSketchOn("XY") | ||||
|   |> line(endAbsolute = [width, 0]) | ||||
|   |> line(endAbsolute = [width, height]) | ||||
|   |> line(endAbsolute = [0, height]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> extrude(length = thickness) | ||||
|  | ||||
| keychain1 = startSketchOn("XY") | ||||
| @ -114,7 +114,7 @@ keychain1 = startSketchOn("XY") | ||||
|   |> line(endAbsolute = [width, 0]) | ||||
|   |> line(endAbsolute = [width, height]) | ||||
|   |> line(endAbsolute = [0, height]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> extrude(length = thickness) | ||||
|  | ||||
| keychain2 = startSketchOn("XY") | ||||
| @ -122,7 +122,7 @@ keychain2 = startSketchOn("XY") | ||||
|   |> line(endAbsolute = [width, 0]) | ||||
|   |> line(endAbsolute = [width, height]) | ||||
|   |> line(endAbsolute = [0, height]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> extrude(length = thickness) | ||||
|  | ||||
| box = startSketchOn('XY') | ||||
| @ -130,7 +130,7 @@ box = startSketchOn('XY') | ||||
|   |> line(end = [0, 10]) | ||||
|   |> line(end = [10, 0]) | ||||
|   |> line(end = [0, -10], tag = $revolveAxis) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> extrude(length = 10) | ||||
|  | ||||
| sketch001 = startSketchOn(box, revolveAxis) | ||||
| @ -138,7 +138,7 @@ sketch001 = startSketchOn(box, revolveAxis) | ||||
|   |> line(end = [0, -10]) | ||||
|   |> line(end = [2, 0]) | ||||
|   |> line(end = [0, -10]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> revolve({ | ||||
|   axis: revolveAxis, | ||||
|   angle: 90 | ||||
| @ -147,7 +147,7 @@ sketch001 = startSketchOn(box, revolveAxis) | ||||
| sketch001 = startSketchOn('XZ') | ||||
|   |> startProfileAt([0.0, 0.0], %) | ||||
|   |> xLine(0.0, %) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|  | ||||
| ` | ||||
|  | ||||
|  | ||||
| @ -35,7 +35,7 @@ test.describe('Testing constraints', () => { | ||||
|     await u.closeDebugPanel() | ||||
|  | ||||
|     // Click the line of code for line. | ||||
|     await page.getByText(`line([0, 20], %)`).click() // TODO remove this and reinstate // await topHorzSegmentClick() | ||||
|     await page.getByText(`line(end = [0, 20])`).click() // TODO remove this and reinstate // await topHorzSegmentClick() | ||||
|     await page.waitForTimeout(100) | ||||
|  | ||||
|     // enter sketch again | ||||
| @ -46,7 +46,7 @@ test.describe('Testing constraints', () => { | ||||
|  | ||||
|     const startXPx = 500 | ||||
|  | ||||
|     await page.getByText(`line([0, 20], %)`).click() | ||||
|     await page.getByText(`line(end = [0, 20])`).click() | ||||
|     await page.waitForTimeout(100) | ||||
|     await page.getByTestId('constraint-length').click() | ||||
|     await page.getByTestId('cmd-bar-arg-value').getByRole('textbox').fill('20') | ||||
| @ -101,7 +101,7 @@ test.describe('Testing constraints', () => { | ||||
|     await homePage.goToModelingScene() | ||||
|     await u.waitForPageLoad() | ||||
|  | ||||
|     await page.getByText('line([74.36, 130.4], %, $seg01)').click() | ||||
|     await page.getByText('line(end = [74.36, 130.4], tag = $seg01)').click() | ||||
|     await page.getByRole('button', { name: 'Edit Sketch' }).click() | ||||
|  | ||||
|     // Wait for overlays to populate | ||||
| @ -118,7 +118,7 @@ test.describe('Testing constraints', () => { | ||||
|       .click() | ||||
|     await page.getByRole('button', { name: 'remove constraints' }).click() | ||||
|  | ||||
|     await page.getByText('line([39.13, 68.63], %)').click() | ||||
|     await page.getByText('line(end = [39.13, 68.63])').click() | ||||
|     await pollEditorLinesSelectedLength(page, 1) | ||||
|     const activeLinesContent = await page.locator('.cm-activeLine').all() | ||||
|     await expect(activeLinesContent[0]).toHaveText( | ||||
| @ -192,7 +192,7 @@ test.describe('Testing constraints', () => { | ||||
|         await homePage.goToModelingScene() | ||||
|         await u.waitForPageLoad() | ||||
|  | ||||
|         await page.getByText('line([74.36, 130.4], %, $seg01)').click() | ||||
|         await page.getByText('line(end = [74.36, 130.4], tag = $seg01)').click() | ||||
|         await page.getByRole('button', { name: 'Edit Sketch' }).click() | ||||
|  | ||||
|         // Give time for overlays to populate | ||||
| @ -301,7 +301,7 @@ test.describe('Testing constraints', () => { | ||||
|         await homePage.goToModelingScene() | ||||
|         await u.waitForPageLoad() | ||||
|  | ||||
|         await page.getByText('line([74.36, 130.4], %)').click() | ||||
|         await page.getByText('line(end = [74.36, 130.4])').click() | ||||
|         await page.getByRole('button', { name: 'Edit Sketch' }).click() | ||||
|  | ||||
|         // Wait for overlays to populate | ||||
| @ -411,7 +411,7 @@ test.describe('Testing constraints', () => { | ||||
|         await homePage.goToModelingScene() | ||||
|         await u.waitForPageLoad() | ||||
|  | ||||
|         await page.getByText('line([74.36, 130.4], %)').click() | ||||
|         await page.getByText('line(end = [74.36, 130.4])').click() | ||||
|         await page.getByRole('button', { name: 'Edit Sketch' }).click() | ||||
|  | ||||
|         // Wait for overlays to populate | ||||
| @ -526,7 +526,7 @@ test.describe('Testing constraints', () => { | ||||
|         await homePage.goToModelingScene() | ||||
|         await u.waitForPageLoad() | ||||
|  | ||||
|         await page.getByText('line([74.36, 130.4], %)').click() | ||||
|         await page.getByText('line(end = [74.36, 130.4])').click() | ||||
|         await page.getByRole('button', { name: 'Edit Sketch' }).click() | ||||
|  | ||||
|         // Wait for overlays to populate | ||||
| @ -628,7 +628,7 @@ test.describe('Testing constraints', () => { | ||||
|         await homePage.goToModelingScene() | ||||
|         await u.waitForPageLoad() | ||||
|  | ||||
|         await page.getByText('line([74.36, 130.4], %)').click() | ||||
|         await page.getByText('line(end = [74.36, 130.4])').click() | ||||
|         await page.getByRole('button', { name: 'Edit Sketch' }).click() | ||||
|  | ||||
|         // Wait for overlays to populate | ||||
| @ -715,7 +715,7 @@ part002 = startSketchOn('XZ') | ||||
|  | ||||
|         await homePage.goToModelingScene() | ||||
|  | ||||
|         await page.getByText('line([74.36, 130.4], %)').click() | ||||
|         await page.getByText('line(end = [74.36, 130.4])').click() | ||||
|         await page.getByRole('button', { name: 'Edit Sketch' }).click() | ||||
|  | ||||
|         const line3 = await u.getSegmentBodyCoords( | ||||
| @ -794,7 +794,7 @@ part002 = startSketchOn('XZ') | ||||
|         await homePage.goToModelingScene() | ||||
|         await u.waitForPageLoad() | ||||
|  | ||||
|         await page.getByText('line([74.36, 130.4], %)').click() | ||||
|         await page.getByText('line(end = [74.36, 130.4])').click() | ||||
|         await page.getByRole('button', { name: 'Edit Sketch' }).click() | ||||
|  | ||||
|         // Wait for overlays to populate | ||||
| @ -896,7 +896,7 @@ part002 = startSketchOn('XZ') | ||||
|         await homePage.goToModelingScene() | ||||
|         await u.waitForPageLoad() | ||||
|  | ||||
|         await page.getByText('line([74.36, 130.4], %)').click() | ||||
|         await page.getByText('line(end = [74.36, 130.4])').click() | ||||
|         await page.getByRole('button', { name: 'Edit Sketch' }).click() | ||||
|  | ||||
|         // Wait for overlays to populate | ||||
| @ -977,7 +977,7 @@ part002 = startSketchOn('XZ') | ||||
|         await homePage.goToModelingScene() | ||||
|         await u.waitForPageLoad() | ||||
|  | ||||
|         await page.getByText('line([74.36, 130.4], %)').click() | ||||
|         await page.getByText('line(end = [74.36, 130.4])').click() | ||||
|         await page.getByRole('button', { name: 'Edit Sketch' }).click() | ||||
|  | ||||
|         // Wait for overlays to populate | ||||
| @ -1032,7 +1032,7 @@ part002 = startSketchOn('XZ') | ||||
|       await homePage.goToModelingScene() | ||||
|       await u.waitForPageLoad() | ||||
|  | ||||
|       await page.getByText('line([3.79, 2.68], %, $seg01)').click() | ||||
|       await page.getByText('line(end = [3.79, 2.68], tag = $seg01)').click() | ||||
|       await expect( | ||||
|         page.getByRole('button', { name: 'Edit Sketch' }) | ||||
|       ).toBeEnabled({ timeout: 10_000 }) | ||||
|  | ||||
| @ -269,7 +269,7 @@ test.describe(`Testing gizmo, fixture-based`, () => { | ||||
|                segAng(rectangleSegmentA001), | ||||
|                -segLen(rectangleSegmentA001) | ||||
|              ], %) | ||||
|           |> close(%) | ||||
|           |> close() | ||||
|         const sketch001 = startSketchOn('XZ') | ||||
|           |> circle({ | ||||
|                center: [818.33, 168.1], | ||||
|  | ||||
| @ -290,7 +290,7 @@ test.describe('Testing segment overlays', () => { | ||||
|         hoverPos: { x: line.x, y: line.y }, | ||||
|         constraintType: 'xRelative', | ||||
|         expectBeforeUnconstrained: '|> line(end = [0.5, yRel001])', | ||||
|         expectAfterUnconstrained: 'line([xRel001, yRel001], %)', | ||||
|         expectAfterUnconstrained: 'line(end = [xRel001, yRel001])', | ||||
|         expectFinal: '|> line(end = [0.5, yRel001])', | ||||
|         ang: ang + 180, | ||||
|         locator: '[data-overlay-index="0"]', | ||||
| @ -1137,7 +1137,7 @@ test.describe('Testing segment overlays', () => { | ||||
|       ang = await u.getAngle(`[data-overlay-index="${0}"]`) | ||||
|       await deleteSegmentSequence({ | ||||
|         hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y }, | ||||
|         codeToBeDeleted: 'line([0.5, -14 + 0], %)', | ||||
|         codeToBeDeleted: 'line(end = [0.5, -14 + 0])', | ||||
|         stdLibFnName: 'line', | ||||
|         ang: ang + 180, | ||||
|       }) | ||||
| @ -1147,7 +1147,7 @@ test.describe('Testing segment overlays', () => { | ||||
|   }) | ||||
|   test.describe('Testing delete with dependent segments', () => { | ||||
|     const cases = [ | ||||
|       'line([22, 2], %, $seg01)', | ||||
|       'line(end = [22, 2], tag = $seg01)', | ||||
|       'angledLine([5, 23.03], %, $seg01)', | ||||
|       'xLine(23, %, $seg01)', | ||||
|       'yLine(-8, %, $seg01)', | ||||
| @ -1283,45 +1283,45 @@ test.describe('Testing segment overlays', () => { | ||||
|   test.describe('Testing remove constraints segments', () => { | ||||
|     const cases = [ | ||||
|       { | ||||
|         before: `line([22 + 0, 2 + 0], %, $seg01)`, | ||||
|         after: `line([22, 2], %, $seg01)`, | ||||
|         before: `line(end = [22 + 0, 2 + 0], tag = $seg01)`, | ||||
|         after: `line(end = [22, 2], tag = $seg01)`, | ||||
|       }, | ||||
|  | ||||
|       { | ||||
|         before: `angledLine([5 + 0, 23.03 + 0], %, $seg01)`, | ||||
|         after: `line([22.94, 2.01], %, $seg01)`, | ||||
|         after: `line(end = [22.94, 2.01], tag = $seg01)`, | ||||
|       }, | ||||
|       { | ||||
|         before: `xLine(23 + 0, %, $seg01)`, | ||||
|         after: `line([23, 0], %, $seg01)`, | ||||
|         after: `line(end = [23, 0], tag = $seg01)`, | ||||
|       }, | ||||
|       { | ||||
|         before: `yLine(-8 + 0, %, $seg01)`, | ||||
|         after: `line([0, -8], %, $seg01)`, | ||||
|         after: `line(end = [0, -8], tag = $seg01)`, | ||||
|       }, | ||||
|       { | ||||
|         before: `xLineTo(30 + 0, %, $seg01)`, | ||||
|         after: `line([25, 0], %, $seg01)`, | ||||
|         after: `line(end = [25, 0], tag = $seg01)`, | ||||
|       }, | ||||
|       { | ||||
|         before: `yLineTo(-4 + 0, %, $seg01)`, | ||||
|         after: `line([0, -10], %, $seg01)`, | ||||
|         after: `line(end = [0, -10], tag = $seg01)`, | ||||
|       }, | ||||
|       { | ||||
|         before: `angledLineOfXLength({ angle = 3 + 0, length = 30 + 0 }, %, $seg01)`, | ||||
|         after: `line([30, 1.57], %, $seg01)`, | ||||
|         after: `line(end = [30, 1.57], tag = $seg01)`, | ||||
|       }, | ||||
|       { | ||||
|         before: `angledLineOfYLength({ angle = 3 + 0, length = 1.5 + 0 }, %, $seg01)`, | ||||
|         after: `line([28.62, 1.5], %, $seg01)`, | ||||
|         after: `line(end = [28.62, 1.5], tag = $seg01)`, | ||||
|       }, | ||||
|       { | ||||
|         before: `angledLineToX({ angle = 3 + 0, to = 30 + 0 }, %, $seg01)`, | ||||
|         after: `line([25, 1.31], %, $seg01)`, | ||||
|         after: `line(end = [25, 1.31], tag = $seg01)`, | ||||
|       }, | ||||
|       { | ||||
|         before: `angledLineToY({ angle = 3 + 0, to = 7 + 0 }, %, $seg01)`, | ||||
|         after: `line([19.08, 1], %, $seg01)`, | ||||
|         after: `line(end = [19.08, 1], tag = $seg01)`, | ||||
|       }, | ||||
|     ] | ||||
|  | ||||
|  | ||||
| @ -267,7 +267,7 @@ test.describe('Testing selections', () => { | ||||
|       |> line(end = [112.54, 127.64], tag = $seg02) | ||||
|       |> line(end = [170.36, -121.61], tag = $seg01) | ||||
|       |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|       |> close(%) | ||||
|       |> close() | ||||
|   extrude001 = extrude(sketch001, length = 50) | ||||
|   sketch005 = startSketchOn(extrude001, 'END') | ||||
|     |> startProfileAt([23.24, 136.52], %) | ||||
| @ -275,19 +275,19 @@ test.describe('Testing selections', () => { | ||||
|     |> line(end = [49.4, 2.05]) | ||||
|     |> line(end = [29.69, -46.95]) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|   sketch003 = startSketchOn(extrude001, seg01) | ||||
|     |> startProfileAt([21.23, 17.81], %) | ||||
|     |> line(end = [51.97, 21.32]) | ||||
|     |> line(end = [4.07, -22.75]) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|   sketch002 = startSketchOn(extrude001, seg02) | ||||
|     |> startProfileAt([-100.54, 16.99], %) | ||||
|     |> line(end = [0, 20.03]) | ||||
|     |> line(end = [62.61, 0], tag = $seg03) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|   extrude002 = extrude(sketch002, length = 50) | ||||
|   sketch004 = startSketchOn(extrude002, seg03) | ||||
|     |> startProfileAt([57.07, 134.77], %) | ||||
| @ -295,7 +295,7 @@ test.describe('Testing selections', () => { | ||||
|     |> line(end = [28.8, 6.71]) | ||||
|     |> line(end = [9.19, -25.33]) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|   extrude003 = extrude(sketch004, length = 20) | ||||
|   pipeLength = 40 | ||||
|   pipeSmallDia = 10 | ||||
| @ -320,7 +320,7 @@ test.describe('Testing selections', () => { | ||||
|     |> angledLineToX({ angle = 120, to = pipeSmallDia }, %) | ||||
|     |> line(end = [0, pipeLength]) | ||||
|     |> angledLineToX({ angle = 60, to = pipeLargeDia }, %) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|   rev = revolve({ axis: 'y' }, part009) | ||||
|   ` | ||||
|       ) | ||||
| @ -436,7 +436,7 @@ test.describe('Testing selections', () => { | ||||
|     |> line(end = [112.54, 127.64], tag = $seg02) | ||||
|     |> line(end = [170.36, -121.61], tag = $seg01) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|   extrude001 = extrude(sketch001, length = 50) | ||||
|   launderExtrudeThroughVar = extrude001 | ||||
|   sketch002 = startSketchOn(launderExtrudeThroughVar, seg02) | ||||
| @ -444,7 +444,7 @@ test.describe('Testing selections', () => { | ||||
|     |> line(end = [0, 20.03]) | ||||
|     |> line(end = [62.61, 0], tag = $seg03) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|   ` | ||||
|       ) | ||||
|     }, KCL_DEFAULT_LENGTH) | ||||
| @ -516,7 +516,7 @@ test.describe('Testing selections', () => { | ||||
|         offset = 0 | ||||
|       }, %) | ||||
|   |> tangentialArcTo([13.14 + 0, 13.14], %) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> extrude(length = 5 + 7) | ||||
|     ` | ||||
|       ) | ||||
| @ -678,26 +678,26 @@ test.describe('Testing selections', () => { | ||||
|     await checkCodeAtHoverPosition( | ||||
|       'close', | ||||
|       close, | ||||
|       'close(%)extrude(5+7,%)', | ||||
|       'close(%)' | ||||
|       'close()extrude(5+7,%)', | ||||
|       'close()' | ||||
|     ) | ||||
|     await checkCodeAtHoverPosition( | ||||
|       'closeEdge', | ||||
|       closeEdge, | ||||
|       `close(%)`, | ||||
|       'close(%)' | ||||
|       `close()`, | ||||
|       'close()' | ||||
|     ) | ||||
|     await checkCodeAtHoverPosition( | ||||
|       'closeAdjacentEdge', | ||||
|       closeAdjacentEdge, | ||||
|       `close(%)`, | ||||
|       'close(%)' | ||||
|       `close()`, | ||||
|       'close()' | ||||
|     ) | ||||
|     await checkCodeAtHoverPosition( | ||||
|       'closeOppositeEdge', | ||||
|       closeOppositeEdge, | ||||
|       `close(%)`, | ||||
|       'close(%)' | ||||
|       `close()`, | ||||
|       'close()' | ||||
|     ) | ||||
|  | ||||
|     await checkCodeAtHoverPosition( | ||||
| @ -734,7 +734,7 @@ test.describe('Testing selections', () => { | ||||
|      -segLen(rectangleSegmentA001) | ||||
|    ], %, $yo) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|   extrude001 = extrude(sketch001, length = 100) | ||||
|     |> chamfer({ | ||||
|      length = 30, | ||||
| @ -853,7 +853,7 @@ test.describe('Testing selections', () => { | ||||
|     |> line(end = [-0.18, -3.36]) | ||||
|     |> line(end = [-3.86, -2.73]) | ||||
|     |> line(end = [-17.67, 0.85]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|   extrude001 = extrude(sketch001, length = 10) | ||||
|     ` | ||||
|       ) | ||||
| @ -869,8 +869,8 @@ test.describe('Testing selections', () => { | ||||
|     await u.closeDebugPanel() | ||||
|  | ||||
|     const selectUnExtrudable = async () => { | ||||
|       await editor.scrollToText(`line([4.99, -0.46], %, $seg01)`) | ||||
|       await page.getByText(`line([4.99, -0.46], %, $seg01)`).click() | ||||
|       await editor.scrollToText(`line(end = [4.99, -0.46], tag = $seg01)`) | ||||
|       await page.getByText(`line(end = [4.99, -0.46], tag = $seg01)`).click() | ||||
|     } | ||||
|     const clickEmpty = () => page.mouse.click(700, 460) | ||||
|     await selectUnExtrudable() | ||||
| @ -889,7 +889,7 @@ test.describe('Testing selections', () => { | ||||
|     |> line(end = [2.45, -0.2]) | ||||
|     |> line(end = [-2, -1.25]) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|   ` | ||||
|     await u.codeLocator.fill(codeToAdd) | ||||
|  | ||||
| @ -921,7 +921,7 @@ test.describe('Testing selections', () => { | ||||
|     const cases = [ | ||||
|       { | ||||
|         pos: [694, 185], | ||||
|         expectedCode: 'line([74.36, 130.4], %, $seg01)', | ||||
|         expectedCode: 'line(end = [74.36, 130.4], tag = $seg01)', | ||||
|       }, | ||||
|       { | ||||
|         pos: [816, 244], | ||||
| @ -994,7 +994,7 @@ test.describe('Testing selections', () => { | ||||
|     |> line(end = [112.54, 127.64]) | ||||
|     |> line(end = [170.36, -121.61], tag = $seg01) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|   extrude001 = extrude(sketch001, length = 50) | ||||
|       ` | ||||
|       ) | ||||
| @ -1025,7 +1025,7 @@ test.describe('Testing selections', () => { | ||||
|     let selectColor: [number, number, number] = [155, 155, 105] | ||||
|  | ||||
|     const extrudeWall = { x: 670, y: 275 } | ||||
|     const extrudeText = `line([170.36, -121.61], %, $seg01)` | ||||
|     const extrudeText = `line(end = [170.36, -121.61], tag = $seg01)` | ||||
|  | ||||
|     const cap = { x: 594, y: 283 } | ||||
|     const capText = `startProfileAt([-79.26, 95.04], %)` | ||||
| @ -1109,7 +1109,7 @@ test.describe('Testing selections', () => { | ||||
|   |> line(end = [5.25, -5.72]) | ||||
|   |> line(end = [-2.01, -10.35]) | ||||
|   |> line(end = [-27.65, -2.78]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|   |> extrude(length = 5) | ||||
|     sketch002 = startSketchOn('XZ') | ||||
|   ${extrudeAndEditAllowed} | ||||
| @ -1117,7 +1117,7 @@ test.describe('Testing selections', () => { | ||||
|   |> line(end = [9.71, -6.16]) | ||||
|   |> line(end = [-3.08, -9.86]) | ||||
|   |> line(end = [-12.02, -1.54]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
|     sketch003 = startSketchOn('XZ') | ||||
|   ${editOnly} | ||||
|   |> line(end = [27.55, -1.65]) | ||||
|  | ||||
| @ -718,7 +718,7 @@ test.describe('Testing settings', () => { | ||||
|     |> line(end = [0, 5]) | ||||
|     |> line(end = [-5, 0]) | ||||
|     |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|     |> close(%) | ||||
|     |> close() | ||||
|   extrude001 = extrude(sketch001, length = 5) | ||||
|   ` | ||||
|       ) | ||||
|  | ||||
| @ -76,7 +76,7 @@ part001 = startSketchOn('-XZ') | ||||
|     }, %) | ||||
| |> angledLineToY([segAng(seg02) + 180, -baseHeight], %) | ||||
| |> xLineTo(ZERO, %) | ||||
| |> close(%) | ||||
| |> close() | ||||
| |> extrude(length = 4)` | ||||
|     ) | ||||
|   }) | ||||
| @ -462,7 +462,7 @@ test('Sketch on face', async ({ page, homePage }) => { | ||||
| |> line(end = [-0.18, -3.36]) | ||||
| |> line(end = [-3.86, -2.73]) | ||||
| |> line(end = [-17.67, 0.85]) | ||||
| |> close(%) | ||||
| |> close() | ||||
| extrude001 = extrude(sketch001, length = 5 + 7)` | ||||
|     ) | ||||
|   }) | ||||
| @ -523,7 +523,7 @@ extrude001 = extrude(sketch001, length = 5 + 7)` | ||||
|   |> line(end = [2.45, -0.2]) | ||||
|   |> line(end = [-2.6, -1.25]) | ||||
|   |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
|   |> close(%) | ||||
|   |> close() | ||||
| `) | ||||
|   ) | ||||
|  | ||||
| @ -561,7 +561,7 @@ extrude001 = extrude(sketch001, length = 5 + 7)` | ||||
| |> line(end = [${[2.28, 2.35]}, -${0.07}]) | ||||
| |> line(end = [-3.05, -1.47]) | ||||
| |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) | ||||
| |> close(%)` | ||||
| |> close()` | ||||
|  | ||||
|   await expect(page.locator('.cm-content')).toHaveText(result.regExp) | ||||
|  | ||||
|  | ||||
| @ -209,5 +209,6 @@ | ||||
|     "wasm-pack": "^0.13.1", | ||||
|     "ws": "^8.17.0", | ||||
|     "yarn": "^1.22.22" | ||||
|   } | ||||
|   }, | ||||
|   "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" | ||||
| } | ||||
|  | ||||
| @ -92,14 +92,14 @@ export function isSketchVariablesLinked( | ||||
|   that way it can find fn calls that are linked to each other through variables eg: | ||||
|   const part001 = startSketchAt([0, 0]) | ||||
|     |> xLineTo(1.69, %) | ||||
|     |> line([myVar, 0.38], %) // ❗️ <- cursor in this fn call (the primary) | ||||
|     |> line([0.41, baz], %) | ||||
|     |> line(end = [myVar, 0.38]) // ❗️ <- cursor in this fn call (the primary) | ||||
|     |> line(end = [0.41, baz]) | ||||
|     |> xLine(0.91, %) | ||||
|     |> angledLine([37, 2], %) | ||||
|   const yo = line([myVar, 0.38], part001) | ||||
|     |> line([1, 1], %) | ||||
|     |> line(end = [1, 1]) | ||||
|   const yo2 = line([myVar, 0.38], yo) | ||||
|     |> line([1, 1], %) // ❗️ <- and cursor here (secondary) is linked to the one above through variables | ||||
|     |> line(end = [1, 1]) // ❗️ <- and cursor here (secondary) is linked to the one above through variables | ||||
|   */ | ||||
|   const secondaryVarName = secondaryVarDec?.id?.name | ||||
|   if (!secondaryVarName) return false | ||||
|  | ||||
| @ -174,7 +174,7 @@ export type SimplifiedArgDetails = | ||||
|  * @property {Expr} callExp - This is the main result; recasting the expression should give the user the new function call. | ||||
|  * @property {number} [valueUsedInTransform] - Aside from `callExp`, we also return the number used in the transform, which is useful for constraints. | ||||
|  * For example, when adding a "horizontal distance" constraint, we don't want the segments to move, just constrain them in place. | ||||
|  * So the second segment will probably be something like `lineTo([segEndX($firstSegTag) + someLiteral, 123], %)` where `someLiteral` is | ||||
|  * So the second segment will probably be something like `line(endAbsolute = [segEndX($firstSegTag) + someLiteral, 123])` where `someLiteral` is | ||||
|  * the value of the current horizontal distance, That is we calculate the value needed to constrain the second segment without it moving. | ||||
|  * We can run the ast-mod to get this constraint `valueUsedInTransform` without applying the mod so that we can surface this to the user in a modal. | ||||
|  * We show them the modal where they can specify the distance they want to constrain to. | ||||
|  | ||||
| @ -25,10 +25,10 @@ thickness = sqrt(moment * factorOfSafety * 6 / (sigmaAllow * width)) // this is | ||||
| // Sketch the bracket body and fillet the inner and outer edges of the bend | ||||
| bracketLeg1Sketch = startSketchOn('XY') | ||||
|   |> startProfileAt([0, 0], %) | ||||
|   |> line([shelfMountL - filletRadius, 0], %, $fillet1) | ||||
|   |> line([0, width], %, $fillet2) | ||||
|   |> line([-shelfMountL + filletRadius, 0], %) | ||||
|   |> close(%) | ||||
|   |> line(end = [shelfMountL - filletRadius, 0], tag = $fillet1) | ||||
|   |> line(end = [0, width], tag = $fillet2) | ||||
|   |> line(end = [-shelfMountL + filletRadius, 0]) | ||||
|   |> close() | ||||
|   |> hole(circle({ | ||||
|        center = [1, 1], | ||||
|        radius = mountingHoleDiameter / 2 | ||||
| @ -59,13 +59,13 @@ bracketLeg1Extrude = extrude(thickness, bracketLeg1Sketch) | ||||
| // Sketch the fillet arc | ||||
| filletSketch = startSketchOn('XZ') | ||||
|   |> startProfileAt([0, 0], %) | ||||
|   |> line([0, thickness], %) | ||||
|   |> line(end = [0, thickness]) | ||||
|   |> arc({ | ||||
|        angleEnd = 180, | ||||
|        angleStart = 90, | ||||
|        radius = filletRadius + thickness | ||||
|      }, %) | ||||
|   |> line([thickness, 0], %) | ||||
|   |> line(end = [thickness, 0]) | ||||
|   |> arc({ | ||||
|        angleEnd = 90, | ||||
|        angleStart = 180, | ||||
| @ -88,10 +88,10 @@ customPlane = { | ||||
| // Create a sketch for the second leg | ||||
| bracketLeg2Sketch = startSketchOn(customPlane) | ||||
|   |> startProfileAt([0, -filletRadius], %) | ||||
|   |> line([width, 0], %) | ||||
|   |> line([0, -wallMountL], %, $fillet3) | ||||
|   |> line([-width, 0], %, $fillet4) | ||||
|   |> close(%) | ||||
|   |> line(end = [width, 0]) | ||||
|   |> line(end = [0, -wallMountL], tag = $fillet3) | ||||
|   |> line(end = [-width, 0], tag = $fillet4) | ||||
|   |> close() | ||||
|   |> hole(circle({ | ||||
|        center = [1, -1.5], | ||||
|        radius = mountingHoleDiameter / 2 | ||||
|  | ||||
| @ -27,7 +27,7 @@ import { | ||||
|  *  |> angledLine([0, 0], %, $a) | ||||
|  *  |> angledLine([segAng(a) - 90, 0], %, $b) | ||||
|  *  |> angledLine([segAng(a), -segLen(a)], %, $c) | ||||
|  *  |> close(%) | ||||
|  *  |> close() | ||||
|  */ | ||||
| export const getRectangleCallExpressions = ( | ||||
|   rectangleOrigin: [number, number], | ||||
|  | ||||
		Reference in New Issue
	
	Block a user