type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
(key) => expect(keys.includes(key)).toBeFalsy() | best-doctor/ke | src/django-spa/utils/dicts/omit.test.ts | TypeScript |
ArrowFunction |
([source, keys]) => {
const result = omit(source, keys)
Object.entries(result).forEach(([key, value]) => expect(value).toBe(source[key]))
} | best-doctor/ke | src/django-spa/utils/dicts/omit.test.ts | TypeScript |
ArrowFunction |
([key, value]) => expect(value).toBe(source[key]) | best-doctor/ke | src/django-spa/utils/dicts/omit.test.ts | TypeScript |
InterfaceDeclaration |
interface PokeList {
} | alaindet/learn-web-components | courses/stencil/stencil-advanced/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface PokeSearch {
"focusInput": () => Promise<void>;
"pokemonName": string;
} | alaindet/learn-web-components | courses/stencil/stencil-advanced/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface HTMLPokeListElement extends Components.PokeList, HTMLStencilElement {
} | alaindet/learn-web-components | courses/stencil/stencil-advanced/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface HTMLPokeSearchElement extends Components.PokeSearch, HTMLStencilElement {
} | alaindet/learn-web-components | courses/stencil/stencil-advanced/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface HTMLElementTagNameMap {
"poke-list": HTMLPokeListElement;
"poke-search": HTMLPokeSearchElement;
} | alaindet/learn-web-components | courses/stencil/stencil-advanced/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface PokeList {
"onSelectedPokemonName"?: (event: CustomEvent<string>) => void;
} | alaindet/learn-web-components | courses/stencil/stencil-advanced/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface PokeSearch {
"pokemonName"?: string;
} | alaindet/learn-web-components | courses/stencil/stencil-advanced/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface IntrinsicElements {
"poke-list": PokeList;
"poke-search": PokeSearch;
} | alaindet/learn-web-components | courses/stencil/stencil-advanced/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface IntrinsicElements {
"poke-list": LocalJSX.PokeList & JSXBase.HTMLAttributes<HTMLPokeListElement>;
"poke-search": LocalJSX.PokeSearch & JSXBase.HTMLAttributes<HTMLPokeSearchElement>;
} | alaindet/learn-web-components | courses/stencil/stencil-advanced/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface FindOptions extends glob.IOptions {
src?: string;
filter?: string | ((filepath?: string, options?: any) => boolean);
nonull?: boolean;
matchBase?: boolean;
srcBase?: string;
prefixBase?: boolean;
} | 0815Strohhut/DefinitelyTyped | types/globule/index.d.ts | TypeScript |
InterfaceDeclaration |
interface MappingOptions extends FindOptions {
srcBase?: string;
destBase?: string;
ext?: string;
extDot?: 'first' | 'last';
flatten?: boolean;
rename?(p: string): string;
} | 0815Strohhut/DefinitelyTyped | types/globule/index.d.ts | TypeScript |
InterfaceDeclaration |
interface OneMapping {
src: string[];
dest: string;
} | 0815Strohhut/DefinitelyTyped | types/globule/index.d.ts | TypeScript |
InterfaceDeclaration |
interface GlobuleStatic {
/**
* Match one or more globbing patterns against one or more file paths.
* Returns a uniqued array of all file paths that match any of the specified globbing patterns.
*/
match(patterns: string | string[], filepaths: string | string[], options?: minimatch.IOptions): st... | 0815Strohhut/DefinitelyTyped | types/globule/index.d.ts | TypeScript |
ArrowFunction |
item => +item | zaneon/ng-zorro-antd | components/badge/badge-sup.component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'nz-badge-sup',
exportAs: 'nzBadgeSup',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [zoomBadgeMotion],
template: `
<ng-container *ngIf="count <= nzOverflowCount; else overflowTemplate">
<s... | zaneon/ng-zorro-antd | components/badge/badge-sup.component.ts | TypeScript |
MethodDeclaration |
generateMaxNumberArray(): void {
this.maxNumberArray = this.nzOverflowCount.toString().split('');
} | zaneon/ng-zorro-antd | components/badge/badge-sup.component.ts | TypeScript |
MethodDeclaration |
ngOnInit(): void {
this.generateMaxNumberArray();
} | zaneon/ng-zorro-antd | components/badge/badge-sup.component.ts | TypeScript |
MethodDeclaration |
ngOnChanges(changes: SimpleChanges): void {
const { nzOverflowCount, nzCount } = changes;
if (nzCount && typeof nzCount.currentValue === 'number') {
this.count = Math.max(0, nzCount.currentValue);
this.countArray = this.count
.toString()
.split('')
.map(item => +item);
}... | zaneon/ng-zorro-antd | components/badge/badge-sup.component.ts | TypeScript |
FunctionDeclaration |
export function slotGlowEffect(): Script {
const sprite = EntityMemory.to<number>(0)
const center = EntityMemory.to<number>(1)
const width = EntityMemory.to<number>(2)
const startTime = EntityMemory.to<number>(3)
const endTime = EntityMemory.to<number>(4)
const tL = EntityMemory.to<nu... | Dosugamea/sonolus-pjsekai-engine-extended | src/engine/data/scripts/slot-glow-effect.ts | TypeScript |
FunctionDeclaration |
export function getSlotGlowSprite(color: number) {
return customSkinSprite(engineId, 60 + color)
} | Dosugamea/sonolus-pjsekai-engine-extended | src/engine/data/scripts/slot-glow-effect.ts | TypeScript |
ClassDeclaration |
@NgModule({
declarations: [
FormGroupComponent,
FormFieldComponent,
InputMessageGroupWithTemplate
],
imports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
FdFormModule,
InlineHelpModule,
PopoverModule
],
exports: [
... | Toskv/fundamental-ngx | libs/platform/src/lib/components/form/form-group/fdp-form.module.ts | TypeScript |
ClassDeclaration | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// This file must match with:
// * Layouts Protocol.h
export class Protocol {
static Name_User_Persistent_Panel... | JeroenDStout/Ap-Code-IrisBase | Pub_ts/Layouts Protocol.ts | TypeScript |
FunctionDeclaration |
function getWindow(element) { return element.querySelector('ngb-popover-window'); } | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
(html: string) =>
createGenericTestComponent(html, TestComponent) as ComponentFixture<TestComponent> | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
(html: string) => <ComponentFixture<TestOnPushComponent>>createGenericTestComponent(html, TestOnPushComponent) | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(() => { TestBed.configureTestingModule({declarations: [TestComponent], imports: [NgbPopoverModule]}); });
afterEach(() => {
// Cleaning elements, because of a TestBed issue with the id attribute
Array.from(document.body.children).map((element: HTMLElement) => {
if (element.tagName... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => { TestBed.configureTestingModule({declarations: [TestComponent], imports: [NgbPopoverModule]}); } | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
// Cleaning elements, because of a TestBed issue with the id attribute
Array.from(document.body.children).map((element: HTMLElement) => {
if (element.tagName.toLocaleLowerCase() === 'div') {
element.parentNode.removeChild(element);
}
});
} | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
(element: HTMLElement) => {
if (element.tagName.toLocaleLowerCase() === 'div') {
element.parentNode.removeChild(element);
}
} | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(NgbPopoverWindow);
fixture.componentInstance.title = 'Test title';
fixture.detectChanges();
expect(fixture.nativeElement).toHaveCssClass('popover');
expect(fixture.nativeElement).not.toHaveCssClass('bs-popover-top');
expect(fixture.nativeElement.... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(NgbPopoverWindow);
fixture.detectChanges();
expect(fixture.nativeElement).not.toHaveCssClass('my-custom-class');
fixture.componentInstance.popoverClass = 'my-custom-class';
fixture.detectChanges();
expect(fixture.nativeElement).toHaveCssClass('... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({
declarations: [TestComponent, TestOnPushComponent, DestroyableCmpt, TestHooksComponent],
imports: [NgbPopoverModule],
providers: [SpyService]
});
} | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture =
createTestComponent(`<div ngbPopover="Great tip!" popoverTitle="Title" style="margin-top: 100px;"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
const windowEl ... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`
<ng-template #t>Hello, {{name}}!</ng-template>
<div [ngbPopover]="t" popoverTitle="Title" style="margin-top: 100px;"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`
<ng-template #t let-name="name">Hello, {{name}}!</ng-template>
<div [ngbPopover]="t" popoverTitle="Title" style="margin-top: 100px;"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
directive.context.p... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`
<div ngbPopover="Great tip!" popoverTitle="Title" popoverClass="my-custom-class" style="margin-top: 100px;"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectCh... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture =
createTestComponent(`<div ngbPopover="Great tip!" popoverTitle="Title" [popoverClass]="popoverClass"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
const window... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`
<ng-template #t>Hello, {{name}}! <destroyable-cmpt></destroyable-cmpt></ng-template>
<div ngbPopover="Body" [popoverTitle]="t"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
const spyService = fixture... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`
<ng-template #t let-greeting="greeting">{{greeting}}, {{name}}!</ng-template>
<div ngbPopover="!!" [popoverTitle]="t"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
fixture.componentInstance.name = '... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`
<ng-template #t><destroyable-cmpt></destroyable-cmpt></ng-template>
<div [ngbPopover]="t" popoverTitle="Title"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
const spyService = fixture.debugElement.in... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<div ngbPopover="Great tip!"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
const windowEl = getWindow(fixture.nativeElement);
expect(windowEl.... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<div [ngbPopover]="" [popoverTitle]=""></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
const windowEl = getWindow(fixture.nativeElement);
expec... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<div [ngbPopover]="Disabled!" [disablePopover]="true"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
const windowEl = getWindow(fixture.nativeElement... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<div [ngbPopover]="name" [popoverTitle]="title"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
expect(getWindow(fixture.nativeElement)).not.toBeNull(... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<div [ngbPopover]="" popoverTitle="title"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
const windowEl = getWindow(fixture.nativeElement);
ex... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<div [ngbPopover]="name" popoverTitle="title"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
expect(getWindow(fixture.nativeElement)).not.toBeNull();... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<div ngbPopover="Great tip!" popoverTitle="Title"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
expect(getWindow(fixture.nativeElement)).not.toBeNul... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(
`<ng-template [ngIf]="show"><div ngbPopover="Great tip!" popoverTitle="Title"></div></ng-template>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<ng-template [ngIf]="show">
<div ngbPopover="Great tip!" triggers="manual" #p="ngbPopover" (mouseenter)="p.open()"></div>
</ng-template>`);
const directive = fixture.debugElement... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(TestHooksComponent);
fixture.detectChanges();
const popoverWindow = fixture.debugElement.query(By.directive(NgbPopoverWindow));
expect(popoverWindow.nativeElement).toHaveCssClass('popover');
} | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
it('should use requested position', () => {
const fixture = createTestComponent(`<div ngbPopover="Great tip!" placement="left"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
const w... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<div ngbPopover="Great tip!" placement="left"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
const windowEl = getWindow(fixture.nativeElement);
... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createOnPushTestComponent(`<div ngbPopover="Great tip!" placement="left"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
const windowEl = getWindow(fixture.nativeElement);... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<div ngbPopover="Great tip!" placement="right-top"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
const windowEl = getWindow(fixture.nativeElement);
... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(
`<div ngbPopover="Great tip!" [placement]="['left-top','top-left']" style="margin-top: 100px;"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(
`<div ngbPopover="Great tip!" placement="left-top top-left" style="margin-top: 100px;"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
const... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<div ngbPopover="Great tip!" placement="auto"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
const windowEl = getWindow(fixture.nativeElement);
... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
it('should be appended to the element matching the selector passed to "container"', () => {
const selector = 'body';
const fixture = createTestComponent(`<div ngbPopover="Great tip!" container="` + selector + `"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopov... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const selector = 'body';
const fixture = createTestComponent(`<div ngbPopover="Great tip!" container="` + selector + `"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
expect(getWin... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const selector = 'body';
const fixture =
createTestComponent(`<div *ngIf="show" ngbPopover="Great tip!" container="` + selector + `"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
it('should emit events when showing and hiding popover', () => {
const fixture = createTestComponent(
`<div ngbPopover="Great tip!" triggers="click" (shown)="shown()" (hidden)="hidden()"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
let shown... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(
`<div ngbPopover="Great tip!" triggers="click" (shown)="shown()" (hidden)="hidden()"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
let shownSpy = spyOn(fixture.componentInstance, 'shown');
let hiddenSpy ... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(
`<div ngbPopover="Great tip!" triggers="manual" (shown)="shown()" (hidden)="hidden()"></div>`);
let shownSpy = spyOn(fixture.componentInstance, 'shown');
let hiddenSpy = spyOn(fixture.componentInstance, 'hidden');
fixture.componentInstanc... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(
`<div ngbPopover="Great tip!" triggers="manual" (shown)="shown()" (hidden)="hidden()"></div>`);
let shownSpy = spyOn(fixture.componentInstance, 'shown');
let hiddenSpy = spyOn(fixture.componentInstance, 'hidden');
fixture.componentInstanc... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<div ngbPopover="Great tip!" triggers="manual"></div>`);
fixture.detectChanges();
expect(fixture.componentInstance.popover.isOpen()).toBeFalsy();
fixture.componentInstance.popover.open();
fixture.detectChanges();
expect(fixture.componen... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(() => { TestBed.configureTestingModule({declarations: [TestComponent], imports: [NgbPopoverModule]}); });
it('should support toggle triggers', () => {
const fixture = createTestComponent(`<div ngbPopover="Great tip!" triggers="click"></div>`);
const directive = fixture.debugElem... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<div ngbPopover="Great tip!" triggers="click"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'click');
fixture.detectChanges();
expect(getWindow(fixture.nativeElement)).not.toBeNull();... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<div ngbPopover="Great tip!" triggers="mouseenter:click"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'mouseenter');
fixture.detectChanges();
expect(getWindow(fixture.nativeElement))... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<div ngbPopover="Great tip!" triggers="mouseenter:mouseleave click"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'mouseenter');
fixture.detectChanges();
expect(getWindow(fixture.nati... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<div ngbPopover="Great tip!" triggers="manual"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbPopover));
triggerEvent(directive, 'mouseenter');
fixture.detectChanges();
expect(getWindow(fixture.nativeElement)).toBeNull(... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`
<div ngbPopover="Great tip!" triggers="manual" #t="ngbPopover"></div>
<button (click)="t.toggle()">T</button>`);
const button = fixture.nativeElement.querySelector('button');
triggerEvent(button, 'click');
fixture.de... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<div ngbPopover="Great tip!" triggers="manual" #t="ngbPopover"></div>
<button (click)="t.open()">O</button>
<button (click)="t.close()">C</button>`);
const buttons = fixture.nativeElement.querySelectorAll('button');
trigger... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`
<div ngbPopover="Great tip!" triggers="manual" #t="ngbPopover"></div>
<button (click)="t.open()">O</button>`);
const button = fixture.nativeElement.querySelector('button');
triggerEvent(button, 'click'); // open
fix... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`
<div ngbPopover="Great tip!" triggers="manual" #t="ngbPopover"></div>
<button (click)="t.close()">C</button>`);
const button = fixture.nativeElement.querySelector('button');
triggerEvent(button, 'click'); // close
f... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
let config: NgbPopoverConfig;
beforeEach(() => {
TestBed.configureTestingModule({imports: [NgbPopoverModule]});
TestBed.overrideComponent(TestComponent, {set: {template: `<div ngbPopover="Great tip!"></div>`}});
});
beforeEach(inject([NgbPopoverConfig], (c: NgbPopoverConfig) => {
... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({imports: [NgbPopoverModule]});
TestBed.overrideComponent(TestComponent, {set: {template: `<div ngbPopover="Great tip!"></div>`}});
} | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
(c: NgbPopoverConfig) => {
config = c;
config.placement = 'bottom';
config.triggers = 'hover';
config.container = 'body';
config.popoverClass = 'my-custom-class';
} | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(TestComponent);
fixture.detectChanges();
const popover = fixture.componentInstance.popover;
expect(popover.placement).toBe(config.placement);
expect(popover.triggers).toBe(config.triggers);
expect(popover.container).toBe(config.conta... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
let config = new NgbPopoverConfig();
config.placement = 'bottom';
config.triggers = 'hover';
config.popoverClass = 'my-custom-class';
beforeEach(() => {
TestBed.configureTestingModule(
{imports: [NgbPopoverModule], providers: [{provide: NgbPopoverConfig, useValue: config}]}... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule(
{imports: [NgbPopoverModule], providers: [{provide: NgbPopoverConfig, useValue: config}]});
} | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`<div ngbPopover="Great tip!"></div>`);
const popover = fixture.componentInstance.popover;
expect(popover.placement).toBe(config.placement);
expect(popover.triggers).toBe(config.triggers);
expect(popover.popoverClass).toBe(config.popoverClass);... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
/**
* Under very specific conditions ngOnDestroy can be invoked without calling ngOnInit first.
* See discussion in https://github.com/ng-bootstrap/ng-bootstrap/issues/2199 for more details.
*/
it('should not try to call listener cleanup function when no listeners registered', () => {
... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = createTestComponent(`
<ng-template #tpl><div ngbPopover="Great tip!"></div></ng-template>
<button (click)="createAndDestroyTplWithAPopover(tpl)"></button>
`);
const buttonEl = fixture.debugElement.query(By.css('button'));
triggerEvent(buttonEl, 'click'... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ClassDeclaration |
@Injectable()
class SpyService {
called = false;
} | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ClassDeclaration |
@Component({selector: 'test-cmpt', template: ``})
export class TestComponent {
name = 'World';
show = true;
title: string;
placement: string;
popoverClass: string;
@ViewChild(NgbPopover, {static: true}) popover: NgbPopover;
constructor(private _vcRef: ViewContainerRef) {}
createAndDestroyTplWithAPop... | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ClassDeclaration |
@Component({selector: 'test-onpush-cmpt', changeDetection: ChangeDetectionStrategy.OnPush, template: ``})
export class TestOnPushComponent {
} | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ClassDeclaration |
@Component({selector: 'destroyable-cmpt', template: 'Some content'})
export class DestroyableCmpt implements OnDestroy {
constructor(private _spyService: SpyService) {}
ngOnDestroy(): void { this._spyService.called = true; }
} | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
ClassDeclaration |
@Component({selector: 'test-hooks', template: `<div ngbPopover="popover"></div>`})
export class TestHooksComponent implements AfterViewInit {
@ViewChild(NgbPopover, {static: true}) popover;
ngAfterViewInit() { this.popover.open(); }
} | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
MethodDeclaration |
createAndDestroyTplWithAPopover(tpl: TemplateRef<any>) {
this._vcRef.createEmbeddedView(tpl, {}, 0);
this._vcRef.remove(0);
} | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
MethodDeclaration |
shown() {} | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
MethodDeclaration |
hidden() {} | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
MethodDeclaration |
ngOnDestroy(): void { this._spyService.called = true; } | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
MethodDeclaration |
ngAfterViewInit() { this.popover.open(); } | Acidburn0zzz/ng-bootstrap | src/popover/popover.spec.ts | TypeScript |
FunctionDeclaration | /**
* Creates and initializes a basic panel state.
*/
export function createPanelState<
TEmbeddableInput extends EmbeddableInput,
TPlacementMethodArgs extends IPanelPlacementArgs = IPanelPlacementArgs
>(
panelState: PanelState<TEmbeddableInput>,
currentPanels: { [key: string]: DashboardPanelState },
placeme... | AntonPalyok/kibana | src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.ts | TypeScript |
ClassDeclaration |
export default class BlogPost extends Component<any, any> {
static contextTypes = {
auth: PropTypes.instanceOf(AuthService).isRequired
};
constructor() {
super();
this.state = {
post: null,
comments: []
};
}
componentWillMount() {
this.fetchBlogPost();
}
render() {
... | dflor003/react-blogger | app/views/BlogPost/BlogPost.tsx | TypeScript |
MethodDeclaration |
componentWillMount() {
this.fetchBlogPost();
} | dflor003/react-blogger | app/views/BlogPost/BlogPost.tsx | TypeScript |
MethodDeclaration |
render() {
const auth: AuthService = this.context.auth;
const { post, comments } = this.state;
const user = auth.getProfile();
log.info(`Rendering post`, post);
return (
<div>
<BlogPostDetail post={post}/>
<CommentThread comments={comments} user={user}
... | dflor003/react-blogger | app/views/BlogPost/BlogPost.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.