type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
() => { expect(getMaybeDate(' ').isValid()).toBe(false); }
6paklata/kibana
x-pack/legacy/plugins/siem/public/components/formatted_date/maybe_date.test.ts
TypeScript
ArrowFunction
() => { expect(getMaybeDate('2019-05-28T23:05:28.405Z').isValid()).toBe(true); }
6paklata/kibana
x-pack/legacy/plugins/siem/public/components/formatted_date/maybe_date.test.ts
TypeScript
ArrowFunction
() => { expect(getMaybeDate('2019-05-28T23:05:28.405Z').toISOString()).toBe('2019-05-28T23:05:28.405Z'); }
6paklata/kibana
x-pack/legacy/plugins/siem/public/components/formatted_date/maybe_date.test.ts
TypeScript
ArrowFunction
() => { expect(getMaybeDate('1559084770612').isValid()).toBe(true); }
6paklata/kibana
x-pack/legacy/plugins/siem/public/components/formatted_date/maybe_date.test.ts
TypeScript
ArrowFunction
() => { expect( getMaybeDate('1559084770612') .toDate() .toISOString() ).toBe('2019-05-28T23:06:10.612Z'); }
6paklata/kibana
x-pack/legacy/plugins/siem/public/components/formatted_date/maybe_date.test.ts
TypeScript
ArrowFunction
() => { expect(getMaybeDate(1559084770612).isValid()).toBe(true); }
6paklata/kibana
x-pack/legacy/plugins/siem/public/components/formatted_date/maybe_date.test.ts
TypeScript
ArrowFunction
() => { expect( getMaybeDate(1559084770612) .toDate() .toISOString() ).toBe('2019-05-28T23:06:10.612Z'); }
6paklata/kibana
x-pack/legacy/plugins/siem/public/components/formatted_date/maybe_date.test.ts
TypeScript
ArrowFunction
() => { expect( getMaybeDate('20190101') .toDate() .toISOString() ).toBe('1970-01-01T05:36:30.101Z'); }
6paklata/kibana
x-pack/legacy/plugins/siem/public/components/formatted_date/maybe_date.test.ts
TypeScript
FunctionDeclaration
function lineTrim(p1: Coords, p2: Coords, space: number = 0) { var line = { p1: new Coords(), p2: new Coords() }; if (p1.x < p2.x) { line.p1.x = space; line.p2.x = (p2.x - p1.x) + space; } else { line.p2.x = space; line.p1.x = (p1.x - p2.x) + space; } if (p1.y < p2.y) { line.p1.y = space...
jhrdina/tables-editor
app/elements/connection-view/connection-view.ts
TypeScript
ClassDeclaration
/// <reference path="../../bower_components/polymer-ts/polymer-ts.d.ts"/> class Coords { constructor(public x: number = 0, public y: number = 0) { } getCenteredBy(p1: Coords, space: number = 0) { var p2 = new Coords(this.x, this.y); p2.x = p2.x - p1.x + space; p2.y = p2.y - p1.y + space; return p2...
jhrdina/tables-editor
app/elements/connection-view/connection-view.ts
TypeScript
ClassDeclaration
class Curve { start: Coords; p1: Coords; p2: Coords; middle: Coords; p3: Coords; p4: Coords; end: Coords; label1: Coords; label2: Coords; advanced: boolean; constructor() { this.start = new Coords(); this.p1 = new Coords(); this.middle = new Coords(); this.p2 = new Coords(); ...
jhrdina/tables-editor
app/elements/connection-view/connection-view.ts
TypeScript
ClassDeclaration
@component('connection-view') class ConnectionView extends polymer.Base { static space = 100; static angulation = 50; @property({ type: Number }) x1: number; @property({ type: Number }) y1: number; @property({ type: String }) dir1: string; @property({ type: Number }) x2: number; @property({ ...
jhrdina/tables-editor
app/elements/connection-view/connection-view.ts
TypeScript
MethodDeclaration
getCenteredBy(p1: Coords, space: number = 0) { var p2 = new Coords(this.x, this.y); p2.x = p2.x - p1.x + space; p2.y = p2.y - p1.y + space; return p2; }
jhrdina/tables-editor
app/elements/connection-view/connection-view.ts
TypeScript
MethodDeclaration
moveToDir(dir: String, angulation: number) { var point: Coords; if (dir == "left") { point = new Coords(this.x - angulation, this.y); } else if (dir == "up") { point = new Coords(this.x, this.y - angulation); } else if (dir == "down") { point = new Coords(this.x, this.y + angulation);...
jhrdina/tables-editor
app/elements/connection-view/connection-view.ts
TypeScript
MethodDeclaration
between(point: Coords):Coords { var b = new Coords(); b.x = (this.x + point.x) / 2.0; b.y = (this.y + point.y) / 2.0; return b; }
jhrdina/tables-editor
app/elements/connection-view/connection-view.ts
TypeScript
MethodDeclaration
toString() { var str: String; if(this.advanced) { str = "M" + this.start.x + "," + this.start.y + " C"; str += this.p1.x + "," + this.p1.y + " "; str += this.p2.x + "," + this.p2.y + " "; str += this.middle.x + "," + this.middle.y + " M"; str += this.middle.x + "," + this.middle....
jhrdina/tables-editor
app/elements/connection-view/connection-view.ts
TypeScript
MethodDeclaration
@property({computed: 'x1, y1, x2, y2, dir1, dir2'}) frame(x1, y1, x2, y2, dir1, dir2): Coords { var frameCors = new Coords(); var frame = this.$.frame; var svg = this.$.svg; if (x1 < x2) { frameCors.x = (x1 - ConnectionView.space); } else { frameCors.x = (x2 - ConnectionView.space); ...
jhrdina/tables-editor
app/elements/connection-view/connection-view.ts
TypeScript
MethodDeclaration
@property({computed: 'x1, y1, x2, y2, dir1, dir2'}) curve(x1, y1, x2, y2, dir1, dir2): Curve { var curve = new Curve(); var diagonal = lineTrim(new Coords(x1, y1), new Coords(x2, y2), ConnectionView.space); curve.start = diagonal.p1; curve.end = diagonal.p2; curve.advanced = (dir1 == "left" && d...
jhrdina/tables-editor
app/elements/connection-view/connection-view.ts
TypeScript
MethodDeclaration
@property({computed: 'curve, frame'}) middle(curve, frame): Coords { var middle = new Coords(); middle.x = frame.x + curve.middle.x; middle.y = frame.y + curve.middle.y; return middle; }
jhrdina/tables-editor
app/elements/connection-view/connection-view.ts
TypeScript
MethodDeclaration
@property({computed: 'curve'}) curveString(curve): string { return curve.toString(); }
jhrdina/tables-editor
app/elements/connection-view/connection-view.ts
TypeScript
MethodDeclaration
handleDelete(e) { this.fire("delete"); }
jhrdina/tables-editor
app/elements/connection-view/connection-view.ts
TypeScript
FunctionDeclaration
function loadCasesAssignedList() { if (self.personId()) { _casesAssignedList.queryString = "filter.AssignedToId=" + self.personId(); _casesAssignedList.load(); } }
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
FunctionDeclaration
function loadCasesReportedList() { if (self.personId()) { _casesReportedList.queryString = "filter.ReportedById=" + self.personId(); _casesReportedList.load(); } }
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
() => { for (var i = 0; i < this.titleValues.length; i++) { if (this.titleValues[i].id == this.title()) { return this.titleValues[i].value; } } return null; }
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
() => { for (var i = 0; i < this.genderValues.length; i++) { if (this.genderValues[i].id == this.gender()) { return this.genderValues[i].value; } } return null; }
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(autoSave?: boolean | null): Case => { var newItem = new Case(); if (typeof(autoSave) == 'boolean'){ newItem.coalesceConfig.autoSaveEnabled(autoSave); } newItem.parent = this; newItem.parentCollection = this.casesAssigned; newItem....
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(autoSave?: boolean | null): Case => { var newItem = new Case(); if (typeof(autoSave) == 'boolean'){ newItem.coalesceConfig.autoSaveEnabled(autoSave); } newItem.parent = this; newItem.parentCollection = this.casesReported; newItem....
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
() => this.coalesceConfig.baseViewUrl() + '/Case/Table?filter.assignedToId=' + this.personId()
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
() => this.coalesceConfig.baseViewUrl() + '/Case/Table?filter.reportedById=' + this.personId()
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(name: string | null, callback?: (result: ViewModels.Person) => void, reload: boolean = true): JQueryPromise<any> => { return this.invokeWithData({ id: this.parent[this.parent.primaryKeyName](), name: name }, callback, reload); }
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(args = this.args, callback?: (result: ViewModels.Person) => void, reload: boolean = true): JQueryPromise<any> => { return this.invoke(args.name(), callback, reload); }
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(callback?: (result: ViewModels.Person) => void, reload: boolean = true): JQueryPromise<any> | undefined => { var $promptVal: string | null = null; $promptVal = prompt('Name'); if ($promptVal === null) return; var name: string = $promptVal; ...
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(data: Coalesce.ItemResult, callback?: (result: ViewModels.Person) => void, reload: boolean = true) => { if (!this.result()) { this.result(new ViewModels.Person(data.object)); } else { this.result().loadFromDto(data.object); } ...
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(callback?: (result: void) => void, reload: boolean = true): JQueryPromise<any> => { return this.invokeWithData({ id: this.parent[this.parent.primaryKeyName]() }, callback, reload); }
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(data: Coalesce.ItemResult, callback?: (result: void) => void, reload: boolean = true) => { this.result(data.object); if (reload) { var result = this.result(); this.parent.load(null, typeof(callback) == 'function' ? () => callback(result) : undefi...
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
() => callback(result)
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(callback?: (result: string) => void, reload: boolean = true): JQueryPromise<any> => { return this.invokeWithData({ id: this.parent[this.parent.primaryKeyName](), }, callback, reload); }
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(data: Coalesce.ItemResult, callback?: (result: string) => void, reload: boolean = true) => { this.result(data.object); if (reload) { var result = this.result(); this.parent.load(null, typeof(callback) == 'function' ? () => callback(result) : unde...
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(firstName: string | null, title: number | null, callback?: (result: ViewModels.Person) => void, reload: boolean = true): JQueryPromise<any> => { return this.invokeWithData({ id: this.parent[this.parent.primaryKeyName](), firstName: firstName, title: title }, callback, reload); }
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(args = this.args, callback?: (result: ViewModels.Person) => void, reload: boolean = true): JQueryPromise<any> => { return this.invoke(args.firstName(), args.title(), callback, reload); }
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(callback?: (result: ViewModels.Person) => void, reload: boolean = true): JQueryPromise<any> | undefined => { var $promptVal: string | null = null; $promptVal = prompt('First Name'); if ($promptVal === null) return; var firstName: string = $promptVal; ...
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(person: ViewModels.Person | null, callback?: (result: ViewModels.Person) => void, reload: boolean = true): JQueryPromise<any> => { return this.invokeWithData({ person: person ? person.saveToDto() : null }, callback, reload); }
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(args = this.args, callback?: (result: ViewModels.Person) => void, reload: boolean = true): JQueryPromise<any> => { return this.invoke(args.person(), callback, reload); }
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(callback?: (result: ViewModels.Person) => void, reload: boolean = true): JQueryPromise<any> | undefined => { var $promptVal: string | null = null; var person: null = null; return this.invoke(person, callback, reload); }
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(data: any, force: boolean = false, allowCollectionDeletes: boolean = true): void => { if (!data || (!force && this.isLoading())) return; this.isLoading(true); // Set the ID this.myId = data.personId; this.personId(data.personId); // Load the lis...
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(): any => { var dto: any = {}; dto.personId = this.personId(); dto.title = this.title(); dto.firstName = this.firstName(); dto.lastName = this.lastName(); dto.email = this.email(); dto.gender = this.gender(); ...
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
(callback?: () => void): void => { var loadingCount = 0; // See if this.company needs to be loaded. if (this.company() == null && this.companyId() != null) { loadingCount++; var companyObj = new Company(); companyObj.load(this.companyI...
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
() => { loadingCount--; this.company(companyObj); if (loadingCount == 0 && typeof(callback) == "function") { callback(); } }
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
EnumDeclaration
export enum TitleEnum { Mr = 0, Ms = 1, Mrs = 2, Miss = 4, }
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
EnumDeclaration
export enum GenderEnum { NonSpecified = 0, Male = 1, Female = 2, }
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
MethodDeclaration
public setupValidation(): void { if (this.errors !== null) return; this.errors = ko.validation.group([ this.firstName.extend({ minLength: 2, maxLength: 75 }), this.lastName.extend({ minLength: 3, maxLength: 100 }), this.birthDate.extend({ moment: ...
COsborn2/Coalesce
src/Coalesce.Web/Scripts/Generated/Ko.Person.Partial.g.ts
TypeScript
ArrowFunction
({ profile: { name, username, biography, github, twitter, linkedin, picture, cover } }: HeaderProps) => { return ( <header> <div className="relative h-96 w-full overflow-hidden"> <Image src={cover.url} placeholder="blur" blurDataURL=...
angel-codes/portfolio
src/components/header.tsx
TypeScript
TypeAliasDeclaration
type HeaderProps = { profile: Profile; };
angel-codes/portfolio
src/components/header.tsx
TypeScript
ArrowFunction
products => { this.products = products; }
viniciussanchez/cod3r
angular/frontend/src/app/components/product/product-read/product-read.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-product-read', templateUrl: './product-read.component.html', styleUrls: ['./product-read.component.css'] }) export class ProductReadComponent implements OnInit { products: Product[]; displayedColumns = ['id', 'name', 'price', 'action']; constructor(private productService: Prod...
viniciussanchez/cod3r
angular/frontend/src/app/components/product/product-read/product-read.component.ts
TypeScript
MethodDeclaration
ngOnInit(): void { this.productService.read().subscribe(products => { this.products = products; }); }
viniciussanchez/cod3r
angular/frontend/src/app/components/product/product-read/product-read.component.ts
TypeScript
ArrowFunction
(accessToken: string, refreshToken: string, user: User, verified: VerifyCallback) => { console.log("[OAuth2Strategy] applied, accessToken: " + accessToken + " and user: " + JSON.stringify(user)); verified(undefined, user, { accessToken: accessToken }); }
AnayoOleru/quicksi
templates/typescript/fullstack-starters/MERN-ts-app&test/server/config/passport-consumer.ts
TypeScript
ClassDeclaration
export class IfStatement extends Statement { readonly kind:string readonly begin:Lex readonly end:Lex readonly boolExp:Expression readonly trueStatement:Statement readonly falseStatement?:Statement constructor(begin:Lex, end:Lex, boolExp:Expression, trueStatement:Statement, falseStatement?:...
gochaorg/basic
basic-ts/src/ts/ast/IfStatement.ts
TypeScript
ArrowFunction
() => { TestBed.configureTestingModule({ imports: [FormsModule, ReactiveFormsModule, StLabelModule, StClickOutsideModule], declarations: [StTagInputComponent], schemas: [NO_ERRORS_SCHEMA] }) .overrideComponent(StTagInputComponent, { set: { changeDetection: Ch...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { fixture = TestBed.createComponent(StTagInputComponent); comp = fixture.componentInstance; }
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { (fixture.elementRef.nativeElement as HTMLElement).id = null; fixture.detectChanges(); expect(comp.label).toBeNull(); expect(comp.placeholder).toBeNull(); expect(comp.tooltip).toBeNull(); expect(comp.errorMessage).toBeNull(); expect(comp.withAutocomplete).toBeFalsy(); ...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { const id: string = 'test-id'; (fixture.elementRef.nativeElement as HTMLElement).id = id; comp.label = 'Test Label'; comp.items = _cloneDeep(simpleTags); fixture.detectChanges(); const label: HTMLElement = fixture.debugElement.query(By.css('.st-label')).nativeElement; ...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { fixture.detectChanges(); let label: DebugElement = fixture.debugElement.query(By.css('.st-label')); expect(label).toBeNull(); expect(comp.hasLabel).toBeFalsy(); }
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { comp.label = 'test label'; comp.tooltip = 'Test help'; fixture.detectChanges(); const label: DebugElement = fixture.debugElement.query(By.css('.st-label')); expect(comp.hasLabel).toBeTruthy(); expect(label).toBeDefined(); expect(label.nativeElement).toBeDefined(); ...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { comp.placeholder = 'Test help'; fixture.detectChanges(); expect(comp.hasPlaceholder).toBeTruthy(); }
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { comp.placeholder = 'Test help'; comp.items = _cloneDeep(simpleTags); fixture.detectChanges(); expect(comp.hasPlaceholder).toBeFalsy(); }
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { comp.placeholder = 'Test help'; const id: string = 'test-id'; (fixture.elementRef.nativeElement as HTMLElement).id = id; comp.label = 'Test'; fixture.detectChanges(); const input: HTMLInputElement = fixture.debugElement.query(By.css('.inner-input')).nativeElement; spy...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { const id: string = 'test-id'; (fixture.elementRef.nativeElement as HTMLElement).id = id; comp.label = 'Test'; comp.items = _cloneDeep(simpleTags); fixture.detectChanges(); expect(comp.hasFocus).toBeFalsy(); expect(comp.tagSelected).toBeNull(); const tag: HTMLEl...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { const id: string = 'test-id'; (fixture.elementRef.nativeElement as HTMLElement).id = id; comp.label = 'Test'; comp.items = _cloneDeep(simpleTags); fixture.detectChanges(); const tag: HTMLElement = fixture.debugElement.query(By.css('.tag-item')).nativeElement; const co...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { const id: string = 'test-id'; (fixture.elementRef.nativeElement as HTMLElement).id = id; comp.label = 'Test'; comp.items = _cloneDeep(simpleTags); fixture.detectChanges(); expect(comp.hasFocus).toBeFalsy(); expect(comp.tagSelected).toBeNull(); expect(comp.items....
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { }
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { it('if input tag is disabled, remove button is not displayed and tag can not be removed', () => { comp.items = _cloneDeep(simpleTags); comp.disabled = true; fixture.detectChanges(); expect(fixture.nativeElement.querySelector('.icon-cross.remove-tag-button')).toBeNull(...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { comp.items = _cloneDeep(simpleTags); comp.disabled = true; fixture.detectChanges(); expect(fixture.nativeElement.querySelector('.icon-cross.remove-tag-button')).toBeNull(); }
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { comp.items = _cloneDeep(simpleTags); comp.disabled = false; fixture.detectChanges(); const removeButtons = fixture.nativeElement.querySelectorAll('.icon-cross.remove-tag-button'); expect(removeButtons.length).toBe(simpleTags.length); removeButtons[1].cli...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { const id: string = 'test-id'; (fixture.elementRef.nativeElement as HTMLElement).id = id; comp.label = 'Test'; comp.innerInputContent = 'New Tag'; fixture.detectChanges(); expect(comp.items.length).toEqual(0); expect(comp.innerInputContent).not.toEqual(''); expec...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { const id: string = 'test-id'; (fixture.elementRef.nativeElement as HTMLElement).id = id; comp.label = 'Test'; comp.items = _cloneDeep(simpleTags); fixture.detectChanges(); expect(comp.items.length).toEqual(simpleTags.length); expect(comp.isValidInput).toBeTruthy(); ...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { const id: string = 'test-id'; (fixture.elementRef.nativeElement as HTMLElement).id = id; comp.label = 'Test'; comp.innerInputContent = 'New Tag'; comp.items = _cloneDeep(simpleTags); fixture.detectChanges(); expect(comp.items.length).toEqual(simpleTags.length); ...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { const id: string = 'test-id'; (fixture.elementRef.nativeElement as HTMLElement).id = id; comp.label = 'Test'; comp.innerInputContent = 'New Tag'; fixture.detectChanges(); expect(comp.innerInputContent).not.toEqual(''); const input: DebugElement = fixture.debugElement...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { const id: string = 'test-id'; (fixture.elementRef.nativeElement as HTMLElement).id = id; comp.label = 'Test'; comp.innerInputContent = 'New Tag'; fixture.detectChanges(); expect(comp.hasFocus).toBeFalsy(); expect(comp.innerInputContent).not.toBe(''); const cont...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { const id: string = 'test-id'; (fixture.elementRef.nativeElement as HTMLElement).id = id; comp.label = 'Test'; comp.placeholder = 'Test help'; comp.setDisabledState(true); fixture.detectChanges(); expect(comp.disableValue).toEqual(''); const input: HTMLInputEle...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { const id: string = 'test-id'; (fixture.elementRef.nativeElement as HTMLElement).id = id; comp.label = 'Test'; comp.items = _cloneDeep(simpleTags); comp.setDisabledState(true); fixture.detectChanges(); expect(comp.disableValue).toEqual(''); expect(comp.hasFocus)...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { comp.isPristine = true; comp.errorMessage = 'This is a fake error message'; fixture.detectChanges(); expect(fixture.nativeElement.querySelector('.st-input-error-message')).toBeNull(); expect(fixture.nativeElement.querySelector('.st-tag-input__input').classList).not.toContain('err...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { comp.isPristine = false; comp.errorMessage = 'This is a fake error message'; fixture.detectChanges(); expect(fixture.nativeElement.querySelector('.st-input-error-message')).not.toBeNull(); expect(fixture.nativeElement.querySelector('.st-tag-input__input').classList).toContain('er...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { comp.forceValidations = true; comp.errorMessage = 'This is a fake error message'; fixture.detectChanges(); expect(fixture.nativeElement.innerHTML).toContain('This is a fake error message'); }
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { comp.forceValidations = false; comp.errorMessage = 'This is a fake error message'; fixture.detectChanges(); expect(fixture.nativeElement.innerHTML).not.toContain('This is a fake error message'); }
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { it('Should display autocomplete list with autocomplete if it is active and after user has typed the required number of characters', () => { const id: string = 'test-id'; (fixture.elementRef.nativeElement as HTMLElement).id = id; comp.label = 'Test'; comp.autocompleteLi...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { const id: string = 'test-id'; (fixture.elementRef.nativeElement as HTMLElement).id = id; comp.label = 'Test'; comp.autocompleteList = [{ value: '1', label: '1' }, { value: '2', label: '2' }]; comp.withAutocomplete = true; fixture.detectChanges(); ...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { const id: string = 'test-id'; (fixture.elementRef.nativeElement as HTMLElement).id = id; comp.label = 'Test'; comp.autocompleteList = [{ value: '1', label: '1' }, { value: '2', label: '2' }]; comp.withAutocomplete = true; comp.items = _cloneDeep(simpleTags)...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { const id: string = 'test-id'; (fixture.elementRef.nativeElement as HTMLElement).id = id; comp.label = 'Test'; comp.autocompleteList = [{ value: '1', label: '1' }, { value: '2', label: '2' }]; comp.withAutocomplete = true; comp.items = _cloneDeep(simpleTags)...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { comp.charsToShowAutocompleteList = 0; comp.withAutocomplete = true; comp.innerInputContent = 'aa'; fixture.detectChanges(); const input: DebugElement = fixture.debugElement.query(By.css('.inner-input')); spyOn(comp.newElementInput.nativeElement, 'dispatchE...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { comp.charsToShowAutocompleteList = 0; comp.withAutocomplete = true; comp.innerInputContent = 'aa'; fixture.detectChanges(); spyOn(comp.newElementInput.nativeElement, 'dispatchEvent').and.callThrough(); fixture.nativeElement.querySelector('.st-tag-input__te...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { it('by default, it allows free text', () => { expect(comp.allowFreeText).toBeTruthy(); }); it('if it allows free text, user can clicks on input an types something', () => { comp.allowFreeText = true; comp.items = []; fixture.detectChanges(); com...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { expect(comp.allowFreeText).toBeTruthy(); }
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { comp.allowFreeText = true; comp.items = []; fixture.detectChanges(); comp.innerInputContent = 'fake value'; const input = fixture.debugElement.query(By.css('.st-tag-input__text.inner-input')); const enterKeyDownEventObj = { keyCode: 13, prevent...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { it('it is displayed by default if item list is empty when it is initialized', () => { comp.infoMessage = fakeInfoMessage; comp.writeValue(_cloneDeep(simpleTags)); fixture.detectChanges(); expect(fixture.nativeElement.querySelector('.info-message')).toBeNull(); ...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { comp.infoMessage = fakeInfoMessage; comp.writeValue(_cloneDeep(simpleTags)); fixture.detectChanges(); expect(fixture.nativeElement.querySelector('.info-message')).toBeNull(); }
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { comp.infoMessage = undefined; fixture.detectChanges(); expect(fixture.nativeElement.querySelector('.info-message')).toBeNull(); comp.infoMessage = fakeInfoMessage; fixture.detectChanges(); expect(fixture.nativeElement.querySelector('.info-message')).not....
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { comp.infoMessage = undefined; fixture.detectChanges(); expect(fixture.nativeElement.querySelector('.info-message')).toBeNull(); comp.infoMessage = fakeInfoMessage; fixture.detectChanges(); expect(fixture.nativeElement.querySelector('.info-message').innerHTML).toEqual(fake...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { let input: DebugElement; let enterKeyDownEventObj: any; beforeEach(() => { fixture.detectChanges(); input = fixture.debugElement.query(By.css('.st-tag-input__text.inner-input')); enterKeyDownEventObj = { keyCode: 13, preventDefault: () => { ...
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript
ArrowFunction
() => { fixture.detectChanges(); input = fixture.debugElement.query(By.css('.st-tag-input__text.inner-input')); enterKeyDownEventObj = { keyCode: 13, preventDefault: () => { } }; }
jmarquez-stratio/egeo
projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts
TypeScript