Skip to content

Commit

Permalink
Merge pull request #307 from SharebookBR/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
raffacabofrio authored Jun 16, 2020
2 parents 939db40 + 039ad8f commit 7301625
Show file tree
Hide file tree
Showing 68 changed files with 1,563 additions and 975 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ testem.log
# System Files
.DS_Store
Thumbs.db

# developer scripts
sandbox
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"singleQuote": true
"singleQuote": true,
"printWidth": 120
}
9 changes: 9 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
"name": "Launch Chrome against localhost",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}"
},
{
"type": "chrome",
"request": "attach",
"name": "Unit tests",
"address": "localhost",
"port": 9333,
"sourceMaps": true,
"webRoot": "${workspaceFolder}"
}
]
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ docker-compose up -d --build
# Criando imagem e rodando o container com Backend LOCAL
docker-compose -f docker-compose-local.yml up -d --build

# Rodando os testes unitários
docker-compose run --rm sharebook npm run test

# Parando o container
docker-compose stop

Expand Down
14 changes: 7 additions & 7 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
Expand Down Expand Up @@ -83,7 +83,7 @@
},
"local": {
"browserTarget": "angular:build:local"
}
}
}
},
"extract-i18n": {
Expand All @@ -97,10 +97,10 @@
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"styles": [
"src/styles.css"
"src/style.scss"
],
"scripts": [],
"assets": [
Expand All @@ -113,8 +113,8 @@
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
"tsconfig.app.json",
"tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.7'

services:
example:
sharebook:
container_name: sharebook-frontend-dev
build:
context: .
Expand Down
25 changes: 18 additions & 7 deletions src/karma.conf.js → karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,33 @@ module.exports = function (config) {
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
require('@angular-devkit/build-angular/plugins/karma'),
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
dir: require('path').join(__dirname, './coverage/teste'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true,
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
customLaunchers: {
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
},
ChromeDebug: {
base: 'Chrome',
flags: ['--remote-debugging-port=9333'],
},
},
singleRun: false,
restartOnFileChange: true,
});
};
};
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "1.0.0",
"version": "v4.5.0",
"description": "It's just a getting started of front end sharebook application",
"main": "index.js",
"repository": {
Expand All @@ -24,8 +24,8 @@
"build-dev": "ng build",
"build-stg": "ng build --configuration=stage",
"build-prod": "ng build --configuration=production",
"test": "ng test",
"test-single": "ng test --watch=false --progress",
"test-debug": "ng test --browsers ChromeDebug",
"test": "ng test --no-watch --no-progress --code-coverage --browsers=ChromeHeadlessCI",
"lint": "ng lint",
"e2e": "ng e2e",
"precommit": "npm run lint",
Expand All @@ -44,7 +44,7 @@
"@ng-bootstrap/ng-bootstrap": "^4.1.1",
"base64-img": "^1.0.4",
"core-js": "^2.5.4",
"moment-timezone": "^0.5.21",
"moment-timezone": "^0.5.31",
"ng-recaptcha": "^3.0.5",
"ng2-completer": "^2.0.8",
"ng2-imageupload": "^1.4.2",
Expand Down
22 changes: 22 additions & 0 deletions sourcelevel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This configuration was used SourceLevel to review the SharebookBR/sharebook-frontend repository
# on 939db40cf82641f3a9aa91f5d3cec9f97c2d5cbb.
# You can make this the default configuration for future reviews by moving this
# file to your repository as `.sourcelevel.yml` and pushing it to GitHub, and tweak
# it as you wish - To know more on how to change this file to better review your
# repository you can go to https://docs.sourcelevel.io/configuration and see the configuration
# details.
---
styleguide: sourcelevel/linters
engines:
fixme:
enabled: true
eslint:
enabled: true
csslint:
enabled: true
sass-lint:
enabled: true
remark-lint:
enabled: true
exclude_paths: []

40 changes: 8 additions & 32 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,53 +1,29 @@
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { TestBed, async } from '@angular/core/testing';
import {RouterTestingModule} from '@angular/router/testing';
import { HttpClient, HttpHandler } from '@angular/common/http';
import { RouterTestingModule } from '@angular/router/testing';
import { AppConfigModule } from './app-config.module';

import { AppComponent } from './app.component';
import { HeaderComponent } from './components/header/header.component';
import { AlertComponent } from './core/directives/alert/alert.component';
import { FooterComponent } from './components/footer/footer.component';

import { UserService } from './core/services/user/user.service';
import { AuthenticationService } from './core/services/authentication/authentication.service';
import { AlertService } from './core/services/alert/alert.service';
import { NO_ERRORS_SCHEMA } from '@angular/core';

describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent,
HeaderComponent,
AlertComponent,
FooterComponent
],
imports: [
RouterTestingModule,
AppConfigModule
],
providers: [
UserService,
AuthenticationService,

HttpClient,
HttpHandler
]
declarations: [AppComponent, HeaderComponent, FooterComponent],
schemas: [NO_ERRORS_SCHEMA],
imports: [RouterTestingModule, AppConfigModule, HttpClientTestingModule],
providers: [UserService, AuthenticationService],
}).compileComponents();
}));

it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
/*it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to angular!');
}));*/
});
2 changes: 1 addition & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['../style.scss']
styleUrls: ['./app.component.css'],
})
export class AppComponent implements OnInit {
ngOnInit() {}
Expand Down
19 changes: 12 additions & 7 deletions src/app/components/account/account.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
/* tslint:disable:no-unused-variable */
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ToastrModule } from 'ngx-toastr';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { RouterTestingModule } from '@angular/router/testing';
import { HttpClient, HttpHandler } from '@angular/common/http';

import { AccountComponent } from './account.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { NgxMaskModule } from 'ngx-mask';

import { AppConfigModule } from '../../app-config.module';
import { UserService } from '../../core/services/user/user.service';
import { ToastrService } from 'ngx-toastr';
import { AddressService } from '../../core/services/address/address.service';

describe('AccountComponent', () => {
Expand All @@ -21,8 +18,16 @@ describe('AccountComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [AccountComponent],
imports: [FormsModule, ReactiveFormsModule, NgxMaskModule.forRoot(), RouterTestingModule, AppConfigModule],
providers: [UserService, AddressService, HttpClient, HttpHandler]
imports: [
FormsModule,
ReactiveFormsModule,
NgxMaskModule.forRoot(),
RouterTestingModule,
AppConfigModule,
ToastrModule.forRoot(),
HttpClientTestingModule,
],
providers: [UserService, AddressService],
}).compileComponents();
}));

Expand Down
Loading

0 comments on commit 7301625

Please sign in to comment.