Skip to content

Commit dc25e4c

Browse files
authored
Merge pull request #1011 from fortran-lang/maint/ui-tests
tests(ui): adds teardown process for Install tests
2 parents e4540f6 + 717d511 commit dc25e4c

File tree

4 files changed

+27
-10
lines changed

4 files changed

+27
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Linting results can be improved by providing additional options to the compiler.
105105
You can control the include paths to be used by the linter with the `fortran.linter.includePaths` option.
106106

107107
| ❗️ Important | For the best linting results `linter.includePaths` should match the included paths for your project's compilation. |
108-
| ------------- | ------------------------------------------------------------------------------------------------------------------ |
108+
| ------------ | ------------------------------------------------------------------------------------------------------------------ |
109109

110110
```json
111111
{
@@ -114,7 +114,7 @@ You can control the include paths to be used by the linter with the `fortran.lin
114114
```
115115

116116
| ❗️ Important | If a glob pattern is used only directories matching the pattern will be included |
117-
| ------------- | -------------------------------------------------------------------------------- |
117+
| ------------ | -------------------------------------------------------------------------------- |
118118

119119
### Additional linting options
120120

src/lint/provider.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@ export class LinterSettings {
166166
}
167167

168168
export class FortranLintingProvider {
169-
constructor(private logger: Logger = new Logger(), private storageUI: string = undefined) {
169+
constructor(
170+
private logger: Logger = new Logger(),
171+
private storageUI: string = undefined
172+
) {
170173
// Register the Linter provider
171174
this.fortranDiagnostics = vscode.languages.createDiagnosticCollection('Fortran');
172175
this.settings = new LinterSettings(this.logger);

src/lsp/client.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ import {
2626
export const clients: Map<string, LanguageClient> = new Map();
2727

2828
export class FortlsClient {
29-
constructor(private logger: Logger, private context?: vscode.ExtensionContext) {
29+
constructor(
30+
private logger: Logger,
31+
private context?: vscode.ExtensionContext
32+
) {
3033
this.logger.debug('[lsp.client] Fortran Language Server -- constructor');
3134

3235
// if context is present

test/ui/install-prompts.test.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ describe('Download dependencies', () => {
1717
await browser.openResources(`${path.resolve(root, 'main.f90')}`);
1818
});
1919

20+
afterEach(async () => {
21+
const center = await new Workbench().openNotificationsCenter();
22+
await center.clearAllNotifications();
23+
});
24+
2025
describe('Download fortls language server', () => {
2126
it('install via pip', async () => {
2227
const workbench = new Workbench();
@@ -26,9 +31,12 @@ describe('Download dependencies', () => {
2631
const message = await info.getMessage();
2732
const actions = await info.getActions();
2833
const title = await actions[0].getTitle();
29-
console.log(message);
30-
await info.takeAction(title);
31-
strictEqual(title, 'Install');
34+
const source = await info.getSource();
35+
if (source.includes('Modern Fortran')) {
36+
console.log(message);
37+
await info.takeAction(title);
38+
strictEqual(title, 'Install');
39+
}
3240
}
3341
});
3442
});
@@ -43,9 +51,12 @@ describe('Download dependencies', () => {
4351
const message = await info.getMessage();
4452
const actions = await info.getActions();
4553
const title = await actions[0].getTitle();
46-
console.log(`2nd lool: ${message}`);
47-
await info.takeAction(title);
48-
strictEqual(title, 'Install');
54+
const source = await info.getSource();
55+
if (source.includes('Modern Fortran')) {
56+
console.log(message);
57+
await info.takeAction(title);
58+
strictEqual(title, 'Install');
59+
}
4960
}
5061
});
5162
});

0 commit comments

Comments
 (0)