From b524d6128595eea2ad106f0ac14017204012ec0c Mon Sep 17 00:00:00 2001 From: Alex Matchneer Date: Fri, 10 Jan 2025 16:29:48 -0500 Subject: [PATCH] Reinstate acceptance tests (gts) (#788) --- .../language-server/diagnostics.test.ts | 4 ++-- .../__fixtures__/custom-app/src/index.custom | 5 ----- .../vscode/__tests__/smoketest-ember.test.ts | 4 ++-- .../smoketest-template-imports.test.ts | 20 +++++++++++-------- 4 files changed, 16 insertions(+), 17 deletions(-) delete mode 100644 packages/vscode/__fixtures__/custom-app/src/index.custom diff --git a/packages/core/__tests__/language-server/diagnostics.test.ts b/packages/core/__tests__/language-server/diagnostics.test.ts index fc6d0f89a..4b3528fc5 100644 --- a/packages/core/__tests__/language-server/diagnostics.test.ts +++ b/packages/core/__tests__/language-server/diagnostics.test.ts @@ -123,7 +123,7 @@ describe('Language Server: Diagnostics', () => { expect(diagnostics).toMatchObject([ { message: "Property 'foo' does not exist on type '{}'.", - source: 'ts', + source: 'glint', code: 2339, }, ]); @@ -165,7 +165,7 @@ describe('Language Server: Diagnostics', () => { expect(diagnostics).toMatchObject([ { message: "Property 'foo' does not exist on type '{}'.", - source: 'ts', + source: 'glint', code: 2339, }, ]); diff --git a/packages/vscode/__fixtures__/custom-app/src/index.custom b/packages/vscode/__fixtures__/custom-app/src/index.custom deleted file mode 100644 index 6d3ff8f29..000000000 --- a/packages/vscode/__fixtures__/custom-app/src/index.custom +++ /dev/null @@ -1,5 +0,0 @@ -import Greeting from './Greeting'; - - diff --git a/packages/vscode/__tests__/smoketest-ember.test.ts b/packages/vscode/__tests__/smoketest-ember.test.ts index 4bf5ad89e..e2b459d54 100644 --- a/packages/vscode/__tests__/smoketest-ember.test.ts +++ b/packages/vscode/__tests__/smoketest-ember.test.ts @@ -52,7 +52,7 @@ describe.skip('Smoke test: Ember', () => { expect(languages.getDiagnostics(templateURI)).toMatchObject([ { message: "Property 'message' does not exist on type 'ColocatedLayoutComponent'.", - source: 'ts', + source: 'glint', code: 2339, range: new Range(0, 7, 0, 14), }, @@ -77,7 +77,7 @@ describe.skip('Smoke test: Ember', () => { expect(languages.getDiagnostics(scriptURI)).toMatchObject([ { message: "Property 'foo' does not exist on type 'MyTestContext'.", - source: 'ts', + source: 'glint', code: 2339, range: new Range(17, 13, 17, 16), }, diff --git a/packages/vscode/__tests__/smoketest-template-imports.test.ts b/packages/vscode/__tests__/smoketest-template-imports.test.ts index 6c0a880ad..4ba8d2abf 100644 --- a/packages/vscode/__tests__/smoketest-template-imports.test.ts +++ b/packages/vscode/__tests__/smoketest-template-imports.test.ts @@ -14,7 +14,7 @@ import { describe, afterEach, test } from 'mocha'; import { expect } from 'expect'; import { waitUntil } from './helpers/async'; -describe.skip('Smoke test: ETI Environment', () => { +describe('Smoke test: ETI Environment', () => { const rootDir = path.resolve(__dirname, '../../__fixtures__/template-imports-app'); afterEach(async () => { @@ -44,7 +44,7 @@ describe.skip('Smoke test: ETI Environment', () => { expect(languages.getDiagnostics(scriptURI)).toMatchObject([ { message: "Type 'number' is not assignable to type 'string'.", - source: 'ts', + source: 'glint', code: 2322, range: new Range(6, 13, 6, 19), }, @@ -75,12 +75,14 @@ describe.skip('Smoke test: ETI Environment', () => { new Range(new Position(10, 9), new Position(10, 9)), ); - expect(fixes.length).toBe(3); + expect(fixes.length).toBe(4); - expect(fixes[1].title).toBe(`Declare property 'undocumentedProperty'`); + const fix = fixes.find((fix) => fix.title === "Declare property 'undocumentedProperty'"); + + expect(fix).toBeDefined(); // apply the missing arg fix - await workspace.applyEdit(fixes![1].edit!); + await workspace.applyEdit(fix!.edit!); await waitUntil( () => @@ -113,12 +115,14 @@ describe.skip('Smoke test: ETI Environment', () => { new Range(new Position(10, 12), new Position(10, 12)), ); - expect(fixes.length).toBe(3); + expect(fixes.length).toBe(4); + + const fix = fixes.find((fix) => fix.title === "Declare property 'localProp'"); - expect(fixes[1].title).toBe(`Declare property 'localProp'`); + expect(fix).toBeDefined(); // select ignore - await workspace.applyEdit(fixes![0].edit!); + await workspace.applyEdit(fix!.edit!); await waitUntil( () =>