Skip to content

Commit

Permalink
Merge pull request #17 from NicolasConstant/develop
Browse files Browse the repository at this point in the history
0.6.0 PR
  • Loading branch information
NicolasConstant authored Jun 8, 2021
2 parents d0d28af + 160dfc6 commit 80a6645
Show file tree
Hide file tree
Showing 53 changed files with 895 additions and 444 deletions.
32 changes: 16 additions & 16 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@
"@angular-eslint/eslint-plugin"
],
"rules": {
// "@typescript-eslint/indent": [
// "error",
// 2,
// {
// "SwitchCase": 1,
// "CallExpression": {
// "arguments": "first"
// },
// "FunctionExpression": {
// "parameters": "first"
// },
// "FunctionDeclaration": {
// "parameters": "first"
// }
// }
// ],
"@typescript-eslint/indent": [
"error",
4,
{
"SwitchCase": 1,
"CallExpression": {
"arguments": "first"
},
"FunctionExpression": {
"parameters": "first"
},
"FunctionDeclaration": {
"parameters": "first"
}
}
],
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-var-requires": 0,
Expand Down
54 changes: 27 additions & 27 deletions e2e/common-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,36 @@ const electronPath = require('electron'); // Require Electron from the binaries
const path = require('path');

export default function setup(): void {
beforeEach(async function () {
this.app = new Application({
// Your electron path can be any binary
// i.e for OSX an example path could be '/Applications/MyApp.app/Contents/MacOS/MyApp'
// But for the sake of the example we fetch it from our node_modules.
path: electronPath,
beforeEach(async function () {
this.app = new Application({
// Your electron path can be any binary
// i.e for OSX an example path could be '/Applications/MyApp.app/Contents/MacOS/MyApp'
// But for the sake of the example we fetch it from our node_modules.
path: electronPath,

// Assuming you have the following directory structure
// Assuming you have the following directory structure

// |__ my project
// |__ ...
// |__ main.js
// |__ package.json
// |__ index.html
// |__ ...
// |__ test
// |__ spec.js <- You are here! ~ Well you should be.
// |__ my project
// |__ ...
// |__ main.js
// |__ package.json
// |__ index.html
// |__ ...
// |__ test
// |__ spec.js <- You are here! ~ Well you should be.

// The following line tells spectron to look and use the main.js file
// and the package.json located 1 level above.
args: [path.join(__dirname, '..')],
webdriverOptions: {}
});
// The following line tells spectron to look and use the main.js file
// and the package.json located 1 level above.
args: [path.join(__dirname, '..')],
webdriverOptions: {}
});

await this.app.start();
});
await this.app.start();
});

afterEach(async function () {
if (this.app && this.app.isRunning()) {
await this.app.stop();
}
});
afterEach(async function () {
if (this.app && this.app.isRunning()) {
await this.app.stop();
}
});
}
28 changes: 14 additions & 14 deletions e2e/main.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ import commonSetup from './common-setup';

describe('msfs-community-downloader App', function () {

commonSetup.apply(this);
commonSetup.apply(this);

let client: SpectronClient;
let client: SpectronClient;

beforeEach(function() {
client = this.app.client;
});
beforeEach(function () {
client = this.app.client;
});

it('creates initial windows', async function () {
const count = await client.getWindowCount();
expect(count).to.equal(1);
});
it('creates initial windows', async function () {
const count = await client.getWindowCount();
expect(count).to.equal(1);
});

it('should display message saying App works !', async function () {
const elem = await client.$('app-home h1');
const text = await elem.getText();
expect(text).to.equal('App works !');
});
it('should display message saying App works !', async function () {
const elem = await client.$('app-home h1');
const text = await elem.getText();
expect(text).to.equal('App works !');
});

});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "msfs-community-downloader",
"version": "0.5.0",
"version": "0.6.0",
"description": "MSFS addin downloader client",
"homepage": "https://github.com/nicolasconstant/msfs-community-downloader",
"author": {
Expand Down
30 changes: 15 additions & 15 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ import { HomeRoutingModule } from './home/home-routing.module';
import { SettingsRoutingModule } from './settings/settings-routing.module';

const routes: Routes = [
{
path: '',
redirectTo: 'home',
pathMatch: 'full'
},
{
path: '**',
component: PageNotFoundComponent
}
{
path: '',
redirectTo: 'home',
pathMatch: 'full'
},
{
path: '**',
component: PageNotFoundComponent
}
];

@NgModule({
imports: [
RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' }),
HomeRoutingModule,
SettingsRoutingModule
],
exports: [RouterModule]
imports: [
RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' }),
HomeRoutingModule,
SettingsRoutingModule
],
exports: [RouterModule]
})
export class AppRoutingModule { }
24 changes: 12 additions & 12 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import { TranslateModule } from '@ngx-translate/core';
import { ElectronService } from './core/services';

describe('AppComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [AppComponent],
providers: [ElectronService],
imports: [RouterTestingModule, TranslateModule.forRoot()]
}).compileComponents();
}));
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [AppComponent],
providers: [ElectronService],
imports: [RouterTestingModule, TranslateModule.forRoot()]
}).compileComponents();
}));

it('should create the app', waitForAsync(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it('should create the app', waitForAsync(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
});
48 changes: 24 additions & 24 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,32 @@ import { ImportModule } from './import/import.module';

// AoT requires an exported function for factories
export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}

@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
FormsModule,
HttpClientModule,
CoreModule,
SharedModule,
HomeModule,
ImportModule,
SettingsModule,
AppRoutingModule,
FontAwesomeModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
})
],
providers: [],
bootstrap: [AppComponent]
declarations: [AppComponent],
imports: [
BrowserModule,
FormsModule,
HttpClientModule,
CoreModule,
SharedModule,
HomeModule,
ImportModule,
SettingsModule,
AppRoutingModule,
FontAwesomeModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
})
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {
export class AppModule {
}
8 changes: 4 additions & 4 deletions src/app/core/core.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

@NgModule({
declarations: [],
imports: [
CommonModule
]
declarations: [],
imports: [
CommonModule
]
})
export class CoreModule { }
16 changes: 8 additions & 8 deletions src/app/core/guards/communityfolder.guard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { TestBed } from '@angular/core/testing';
import { CommunityfolderGuard } from './communityfolder.guard';

describe('CommunityfolderGuard', () => {
let guard: CommunityfolderGuard;
let guard: CommunityfolderGuard;

beforeEach(() => {
TestBed.configureTestingModule({});
guard = TestBed.inject(CommunityfolderGuard);
});
beforeEach(() => {
TestBed.configureTestingModule({});
guard = TestBed.inject(CommunityfolderGuard);
});

it('should be created', () => {
expect(guard).toBeTruthy();
});
it('should be created', () => {
expect(guard).toBeTruthy();
});
});
16 changes: 8 additions & 8 deletions src/app/core/services/domain.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { TestBed } from '@angular/core/testing';
import { DomainService } from './domain.service';

describe('DomainService', () => {
let service: DomainService;
let service: DomainService;

beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(DomainService);
});
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(DomainService);
});

it('should be created', () => {
expect(service).toBeTruthy();
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
16 changes: 8 additions & 8 deletions src/app/core/services/downloader.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { TestBed } from '@angular/core/testing';
import { DownloaderService } from './downloader.service';

describe('DownloaderService', () => {
let service: DownloaderService;
let service: DownloaderService;

beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(DownloaderService);
});
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(DownloaderService);
});

it('should be created', () => {
expect(service).toBeTruthy();
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
10 changes: 5 additions & 5 deletions src/app/core/services/electron/electron.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { TestBed } from '@angular/core/testing';
import { ElectronService } from './electron.service';

describe('ElectronService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
beforeEach(() => TestBed.configureTestingModule({}));

it('should be created', () => {
const service: ElectronService = TestBed.get(ElectronService);
expect(service).toBeTruthy();
});
it('should be created', () => {
const service: ElectronService = TestBed.get(ElectronService);
expect(service).toBeTruthy();
});
});
Loading

0 comments on commit 80a6645

Please sign in to comment.