This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"contact-form--label-lastName": "Numele meu de familie este {$INTERPOLATION} :-)" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as qs from 'querystring'; | |
import 'isomorphic-fetch'; | |
import { | |
AuthenticationHandler, | |
AuthenticationProviderOptions, | |
Client, | |
HTTPMessageHandler | |
} from '@microsoft/microsoft-graph-client'; | |
export function getClient() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as bcrypt from 'bcryptjs'; | |
const hashPassword = (pwd) => { | |
const salt = bcrypt.genSaltSync(10); | |
return bcrypt.hashSync(pwd, salt); | |
}; | |
export const DEFAULT_PASSWORD = 'pwd'; | |
export function defineUserFactory(factory, model) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
beforeEach(async () => { | |
const client: Sequelize.Sequelize = app.get('sequelizeClient'); | |
const models = client.models as {[name: string]: Sequelize.Model<any, any>}; | |
const UserModel = models.users as Sequelize.Model<User, UserAttrs>; | |
await UserModel.destroy({truncate: true}); | |
setupUserRelatedFactory(UserModel); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('POST /users', () => { | |
describe('for correct user/password data', () => { | |
let notifierSpy: sinon.SinonSpy; | |
let mailerStub: sinon.SinonStub; | |
beforeEach(() => { | |
notifierSpy = sinon.spy(Notifier, 'onNotify'); | |
mailerStub = sinon.stub(app.service('mailer'), 'create'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('monkey test', () => { | |
let userInputs: any[] = [ | |
{budget: 70, apple: 1, pear: 2, orange: 3}, | |
{apple: 3, orange: 1}, | |
{budget: 0}, // <<-- causes change detection exception | |
{pear: 10} | |
]; | |
beforeEach(() => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('change detection', () => { | |
let failure = 'There should be the exception: Expression has changed after it was checked'; | |
let spy: any; | |
let myIt: any; | |
beforeEach(() => { | |
fixture.autoDetectChanges(true); | |
patchChangeDetection(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component, OnInit} from 'angular2/core'; | |
import {Tab} from './tab'; | |
import {TabService} from './tab.service'; | |
import {RouteParams} from 'angular2/router'; | |
@Component({ | |
selector: '[tabContent]', | |
template: `<div *ngIf="tab" class="panel panel-default"> | |
<div class="panel-body"> | |
<p class="active">{{tab.content}}</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component, OnInit, ElementRef} from 'angular2/core'; | |
import {Tab} from './tab'; | |
import {RouterLink} from 'angular2/router'; | |
@Component({ | |
selector: '[tabLink]', | |
inputs: ['tab'], | |
directives: [RouterLink], | |
template: ` | |
<a [routerLink]="['Tab', {id: tab.id}]" [attr.aria-controls]="tab.title" role="tab"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component, OnInit} from 'angular2/core'; | |
import {Router, RouterOutlet} from 'angular2/router'; | |
import {Tab} from './tab'; | |
import {TabService} from './tab.service'; | |
import {TabLinkComponent} from './tab-link.component'; | |
import {TabContentComponent} from './tab-content.component'; | |
import {TabFormComponent} from './tab-form.component'; | |
@Component({ | |
selector: 'tabs', |
NewerOlder