type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
(err) => { if (!err) resolve(); }
jzjxiao/genie-toolkit
lib/engine/db/sqlite/migration.ts
TypeScript
ArrowFunction
() => { // we used to create a table called `keyword` here, we no longer do that db.run('drop table if exists channel'); db.run('create table channel (uniqueId varchar(255) primary key, value text default null)'); }
jzjxiao/genie-toolkit
lib/engine/db/sqlite/migration.ts
TypeScript
ArrowFunction
() => { // we used to create a table called `keyword` here, we no longer do that db.run('drop table if exists conversation'); db.run('create table conversation (' + 'uniqueId varchar(255) primary key, ' + 'conversationId varchar(255), ' + 'previousId...
jzjxiao/genie-toolkit
lib/engine/db/sqlite/migration.ts
TypeScript
ArrowFunction
() => { db.run('drop table if exists conversation_state'); db.run('create table conversation_state (' + 'uniqueId varchar(255) primary key, ' + 'history text default null, ' + 'dialogueState text default null, ' + 'lastMessageId int(11) default null)'); ...
jzjxiao/genie-toolkit
lib/engine/db/sqlite/migration.ts
TypeScript
ArrowFunction
(callback, errback) => { db.on('error', errback); if (key) db.run(sql.makeKeyPragma(key)); MIGRATIONS.forEach((migration, migrateTo) => { // migrations start at 1 (see above) migrateTo = migrateTo+1; if (version! < migrateTo) migra...
jzjxiao/genie-toolkit
lib/engine/db/sqlite/migration.ts
TypeScript
ArrowFunction
(migration, migrateTo) => { // migrations start at 1 (see above) migrateTo = migrateTo+1; if (version! < migrateTo) migration(db); }
jzjxiao/genie-toolkit
lib/engine/db/sqlite/migration.ts
TypeScript
ArrowFunction
(err) => { if (!err) console.log('Successfully migrated database to version ' + currentVersion); if (err) errback(err); else callback(); }
jzjxiao/genie-toolkit
lib/engine/db/sqlite/migration.ts
TypeScript
FunctionDeclaration
export function buildContainer(sourceFileVisitor: SourceFileVisitor): void { const configPath = ts.findConfigFile( /*searchPath*/ process.cwd(), ts.sys.fileExists, "tsconfig.json", ); if (!configPath) { throw new Error("Config file tsconfig.json not found!"); } //...
manole-ts/ana
src/compiler/builder.ts
TypeScript
ArrowFunction
(configFile: string): ts.Program => { const projectDirectory = dirname(configFile); const { config } = ts.readConfigFile(configFile, ts.sys.readFile); const parseConfigHost: any = { fileExists: ts.sys.fileExists, readDirectory: ts.sys.readDirectory, readFile: (file: string) => ts.s...
manole-ts/ana
src/compiler/builder.ts
TypeScript
ArrowFunction
(file: string) => ts.sys.readFile(file, "utf8")
manole-ts/ana
src/compiler/builder.ts
TypeScript
ArrowFunction
() => 'This field is required.'
aleh807/MyWarehouse
src/WebUI/src/app/core/errorhandling/form-validation/components/show-validation-errors/show-validation-errors.component.ts
TypeScript
ArrowFunction
(params) => `Value must be at least' ${params.requiredLength} characters long.`
aleh807/MyWarehouse
src/WebUI/src/app/core/errorhandling/form-validation/components/show-validation-errors/show-validation-errors.component.ts
TypeScript
ArrowFunction
(params) => `Value must be shorter than ${params.requiredLength} characters.`
aleh807/MyWarehouse
src/WebUI/src/app/core/errorhandling/form-validation/components/show-validation-errors/show-validation-errors.component.ts
TypeScript
ArrowFunction
(params) => 'The required pattern is: ' + params.requiredPattern
aleh807/MyWarehouse
src/WebUI/src/app/core/errorhandling/form-validation/components/show-validation-errors/show-validation-errors.component.ts
TypeScript
ClassDeclaration
// This component is used to automatically list all known validation errors // pertaining to a given form control. @Component({ selector: 'app-show-validation-errors', template: ` <span class="is-invalid"></span> <!-- Bootstrap's .invalid-feedback relies on .is-invalid sibling. https://github.com/angular/angula...
aleh807/MyWarehouse
src/WebUI/src/app/core/errorhandling/form-validation/components/show-validation-errors/show-validation-errors.component.ts
TypeScript
MethodDeclaration
showList(): boolean { return this.control && this.control.errors && this.shouldShow; }
aleh807/MyWarehouse
src/WebUI/src/app/core/errorhandling/form-validation/components/show-validation-errors/show-validation-errors.component.ts
TypeScript
MethodDeclaration
listOfErrors(): string[] { let errors: string[] = []; for (let field of Object.keys(this.control.errors)) { // Supports two scenario: // 1) If we have a defined message for a built-in validator. // 2) If the error object contains a 'message' property. if (field in ShowValidationError...
aleh807/MyWarehouse
src/WebUI/src/app/core/errorhandling/form-validation/components/show-validation-errors/show-validation-errors.component.ts
TypeScript
FunctionDeclaration
export async function* listEventSubscriptionsPaginate( config: InspectorPaginationConfiguration, input: ListEventSubscriptionsCommandInput, ...additionalArguments: any ): Paginator<ListEventSubscriptionsCommandOutput> { let token: string | undefined = config.startingToken || ""; let hasNext = true; let pag...
justingrant/aws-sdk-js-v3
clients/client-inspector/pagination/ListEventSubscriptionsPaginator.ts
TypeScript
ArrowFunction
async ( client: InspectorClient, input: ListEventSubscriptionsCommandInput, ...args: any ): Promise<ListEventSubscriptionsCommandOutput> => { // @ts-ignore return await client.send(new ListEventSubscriptionsCommand(input, ...args)); }
justingrant/aws-sdk-js-v3
clients/client-inspector/pagination/ListEventSubscriptionsPaginator.ts
TypeScript
ArrowFunction
async ( client: Inspector, input: ListEventSubscriptionsCommandInput, ...args: any ): Promise<ListEventSubscriptionsCommandOutput> => { // @ts-ignore return await client.listEventSubscriptions(input, ...args); }
justingrant/aws-sdk-js-v3
clients/client-inspector/pagination/ListEventSubscriptionsPaginator.ts
TypeScript
ArrowFunction
() => { return ( <DocSubSection className="InstallDependencies" id={InstallDependenciesNav.installDependencies} title="Install Dependencies" > <CodeSnippet code={`sudo add-apt-repository universe sudo apt -y update && sudo apt -y upgrade sudo apt -y install build-essential lib...
AbhayAysola/Website
src/containers/DeploymentGuide/InstallDependencies/index.tsx
TypeScript
EnumDeclaration
enum InstallDependenciesNav { installDependencies = 'install-dependencies', }
AbhayAysola/Website
src/containers/DeploymentGuide/InstallDependencies/index.tsx
TypeScript
FunctionDeclaration
export function Help() { return ( <div className="main-body"> <div className="card settings"> <h1>Help</h1> Contents <ul> <li> <a href="#tutorials">Tutorials</a> </li> <li> <a href="#video-library">Video Library</a> </l...
fritzgrabo/datastation
ui/Help.tsx
TypeScript
ArrowFunction
(t) => ( <li key={t.link}> <a target
fritzgrabo/datastation
ui/Help.tsx
TypeScript
FunctionDeclaration
function ensure<T, K extends keyof T>(target: T, key: K): T[K] { if (target[key] === void 0) { target[key] = {} as any } return target[key] }
BonaBeavis/coc.nvim
src/language-client/selectionRange.ts
TypeScript
ArrowFunction
(document, positions, token) => { const requestParams: SelectionRangeParams = { textDocument: { uri: document.uri }, positions } return client.sendRequest(SelectionRangeRequest.type, requestParams, token).then( ranges => ranges, (error: any) => { client.logF...
BonaBeavis/coc.nvim
src/language-client/selectionRange.ts
TypeScript
ArrowFunction
ranges => ranges
BonaBeavis/coc.nvim
src/language-client/selectionRange.ts
TypeScript
ArrowFunction
(error: any) => { client.logFailedRequest(SelectionRangeRequest.type, error) return Promise.resolve(null) }
BonaBeavis/coc.nvim
src/language-client/selectionRange.ts
TypeScript
ClassDeclaration
export class SelectionRangeFeature extends TextDocumentFeature<TextDocumentRegistrationOptions> { constructor(client: BaseLanguageClient) { super(client, SelectionRangeRequest.type) } public fillClientCapabilities(capabilites: ClientCapabilities & SelectionRangeClientCapabilities): void { let capability...
BonaBeavis/coc.nvim
src/language-client/selectionRange.ts
TypeScript
InterfaceDeclaration
export interface SelectionRangeProviderMiddleware { provideSelectionRanges?: (this: void, document: TextDocument, positions: Position[], token: CancellationToken, next: ProvideSelectionRangeSignature) => ProviderResult<SelectionRange[]> }
BonaBeavis/coc.nvim
src/language-client/selectionRange.ts
TypeScript
InterfaceDeclaration
export interface ProvideSelectionRangeSignature { (document: TextDocument, positions: Position[], token: CancellationToken): ProviderResult<SelectionRange[]> }
BonaBeavis/coc.nvim
src/language-client/selectionRange.ts
TypeScript
MethodDeclaration
public fillClientCapabilities(capabilites: ClientCapabilities & SelectionRangeClientCapabilities): void { let capability = ensure(ensure(capabilites, 'textDocument')!, 'selectionRange')! capability.dynamicRegistration = true }
BonaBeavis/coc.nvim
src/language-client/selectionRange.ts
TypeScript
MethodDeclaration
public initialize(capabilities: ServerCapabilities & SelectionRangeServerCapabilities, documentSelector: DocumentSelector): void { if (!capabilities.selectionRangeProvider) { return } const implCapabilities = capabilities.selectionRangeProvider as TextDocumentRegistrationOptions & StaticRegistration...
BonaBeavis/coc.nvim
src/language-client/selectionRange.ts
TypeScript
MethodDeclaration
protected registerLanguageProvider(options: TextDocumentRegistrationOptions): Disposable { let client = this._client let provideSelectionRanges: ProvideSelectionRangeSignature = (document, positions, token) => { const requestParams: SelectionRangeParams = { textDocument: { uri: document.uri }, ...
BonaBeavis/coc.nvim
src/language-client/selectionRange.ts
TypeScript
MethodDeclaration
provideSelectionRanges(document: TextDocument, positions: Position[], token: CancellationToken): ProviderResult<SelectionRange[]> { return middleware.provideSelectionRanges ? middleware.provideSelectionRanges(document, positions, token, provideSelectionRanges) : provideSelectionRanges(docum...
BonaBeavis/coc.nvim
src/language-client/selectionRange.ts
TypeScript
ArrowFunction
(phase: ScalingInputPhase): string => { const { value, textLengthThreshold, scalingSettings } = this.props; if (_.isEmpty(value)) { return `${this.props.emptyInputWidthCh}ch`; } switch (phase) { case ScalingInputPhase.FixedFontSize: return `${valu...
KevinHu2014/0x-monorepo
packages/instant/src/components/scaling_input.tsx
TypeScript
ArrowFunction
(phase: ScalingInputPhase): number => { return ScalingInput.calculateFontSizeFromProps(this.props, phase); }
KevinHu2014/0x-monorepo
packages/instant/src/components/scaling_input.tsx
TypeScript
ArrowFunction
(): number => { const ref = this._inputRef.current; if (!ref) { return 0; } return ref.getBoundingClientRect().width; }
KevinHu2014/0x-monorepo
packages/instant/src/components/scaling_input.tsx
TypeScript
ClassDeclaration
export class ScalingInput extends React.Component<ScalingInputProps, ScalingInputState> { public static defaultProps = { onChange: util.boundNoop, onFontSizeChange: util.boundNoop, maxLength: 7, scalingSettings: defaultScalingSettings, isDisabled: false, hasAutofocus...
KevinHu2014/0x-monorepo
packages/instant/src/components/scaling_input.tsx
TypeScript
InterfaceDeclaration
export interface ScalingSettings { percentageToReduceFontSizePerCharacter: number; constantPxToIncreaseWidthPerCharacter: number; }
KevinHu2014/0x-monorepo
packages/instant/src/components/scaling_input.tsx
TypeScript
InterfaceDeclaration
export interface ScalingInputProps { textLengthThreshold: number; maxFontSizePx: number; value: string; emptyInputWidthCh: number; onChange: (event: React.ChangeEvent<HTMLInputElement>) => void; onFontSizeChange: (fontSizePx: number) => void; fontColor?: ColorOption; placeholder?: strin...
KevinHu2014/0x-monorepo
packages/instant/src/components/scaling_input.tsx
TypeScript
InterfaceDeclaration
export interface ScalingInputState { inputWidthPxAtPhaseChange?: number; }
KevinHu2014/0x-monorepo
packages/instant/src/components/scaling_input.tsx
TypeScript
InterfaceDeclaration
export interface ScalingInputSnapshot { inputWidthPx: number; }
KevinHu2014/0x-monorepo
packages/instant/src/components/scaling_input.tsx
TypeScript
EnumDeclaration
export enum ScalingInputPhase { FixedFontSize, ScalingFontSize, }
KevinHu2014/0x-monorepo
packages/instant/src/components/scaling_input.tsx
TypeScript
MethodDeclaration
public static getPhase(textLengthThreshold: number, value: string): ScalingInputPhase { if (value.length <= textLengthThreshold) { return ScalingInputPhase.FixedFontSize; } return ScalingInputPhase.ScalingFontSize; }
KevinHu2014/0x-monorepo
packages/instant/src/components/scaling_input.tsx
TypeScript
MethodDeclaration
public static getPhaseFromProps(props: ScalingInputProps): ScalingInputPhase { const { value, textLengthThreshold } = props; return ScalingInput.getPhase(textLengthThreshold, value); }
KevinHu2014/0x-monorepo
packages/instant/src/components/scaling_input.tsx
TypeScript
MethodDeclaration
public static calculateFontSize( textLengthThreshold: number, maxFontSizePx: number, phase: ScalingInputPhase, value: string, percentageToReduceFontSizePerCharacter: number, ): number { if (phase !== ScalingInputPhase.ScalingFontSize) { return maxFontSize...
KevinHu2014/0x-monorepo
packages/instant/src/components/scaling_input.tsx
TypeScript
MethodDeclaration
public static calculateFontSizeFromProps(props: ScalingInputProps, phase: ScalingInputPhase): number { const { textLengthThreshold, value, maxFontSizePx, scalingSettings } = props; return ScalingInput.calculateFontSize( textLengthThreshold, maxFontSizePx, phase, ...
KevinHu2014/0x-monorepo
packages/instant/src/components/scaling_input.tsx
TypeScript
MethodDeclaration
public getSnapshotBeforeUpdate(): ScalingInputSnapshot { return { inputWidthPx: this._getInputWidthInPx(), }; }
KevinHu2014/0x-monorepo
packages/instant/src/components/scaling_input.tsx
TypeScript
MethodDeclaration
public componentDidMount(): void { // Trigger an initial notification of the calculated fontSize. const currentPhase = ScalingInput.getPhaseFromProps(this.props); const currentFontSize = ScalingInput.calculateFontSizeFromProps(this.props, currentPhase); this.props.onFontSizeChange(curre...
KevinHu2014/0x-monorepo
packages/instant/src/components/scaling_input.tsx
TypeScript
MethodDeclaration
public componentDidUpdate( prevProps: ScalingInputProps, prevState: ScalingInputState, snapshot: ScalingInputSnapshot, ): void { const prevPhase = ScalingInput.getPhaseFromProps(prevProps); const curPhase = ScalingInput.getPhaseFromProps(this.props); // if we went fr...
KevinHu2014/0x-monorepo
packages/instant/src/components/scaling_input.tsx
TypeScript
MethodDeclaration
public render(): React.ReactNode { const { hasAutofocus, isDisabled, fontColor, onChange, placeholder, value, maxLength } = this.props; const phase = ScalingInput.getPhaseFromProps(this.props); return ( <Input ref={this._inputRef as any} fontColor={fo...
KevinHu2014/0x-monorepo
packages/instant/src/components/scaling_input.tsx
TypeScript
FunctionDeclaration
/** * Configures the test module for McSelect with the given declarations. This is broken out so * that we're only compiling the necessary test components for each test in order to speed up * overall test time. * @param declarations Components to declare for this block */ function configureMcSe...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
FunctionDeclaration
/** * Asserts that the given option is aligned with the trigger. * @param index The index of the option. * @param selectInstance Instance of the `mc-select` component to check against. */ function checkTriggerAlignedWithOption(index: number, selectInstance = fixture.compo...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
FunctionDeclaration
// Need to set the scrollTop two different ways to support // both Chrome and Firefox. function setScrollTop(num: number) { document.body.scrollTop = num; document.documentElement.scrollTop = num; }
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
(value) => this.getFilteredOptions(value)
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
(option) => option.toLowerCase().includes((searchFilter.toLowerCase()))
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => dir = { value: 'ltr' }
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => ({ scrolled: () => scrolledSubject.asObservable() })
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => scrolledSubject.asObservable()
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
(oc: OverlayContainer, p: Platform) => { overlayContainer = oc; overlayContainerElement = oc.getContainerElement(); platform = p; }
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { overlayContainer.ngOnDestroy(); }
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { configureMcSelectTestingModule([ BasicSelect, BasicEvents, MultiSelect, SelectWithGroups, SelectWithGroupsAndNgContainer, SelectWithFormFieldLabel, SelectWithChangeEvent ]); ...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { fixture = TestBed.createComponent(BasicSelect); fixture.detectChanges(); select = fixture.debugElement.query(By.css('mc-select')).nativeElement; }
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { expect(select.getAttribute('tabindex')).toEqual('0'); }
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { fixture.componentInstance.tabIndexOverride = 3; fixture.detectChanges(); expect(select.getAttribute('tabindex')).toBe('3'); }
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { fixture.componentInstance.control.disable(); fixture.detectChanges(); expect(select.getAttribute('tabindex')).toEqual('-1'); fixture.componentInstance.control.enable(); fixture.detectChanges(); ...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { const formControl = fixture.componentInstance.control; const options = fixture.componentInstance.options.toArray(); expect(formControl.value).toBeFalsy('Expected no initial value.'); dispatchKeyboardEvent(select, 'keydown', DOWN_...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { const formControl = fixture.componentInstance.control; const options = fixture.componentInstance.options.toArray(); expect(formControl.value).toBeFalsy('Expected no initial value.'); fixture.componentInstance.select.open(); ...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { const formControl = fixture.componentInstance.control; const options = fixture.componentInstance.options.toArray(); expect(formControl.value).toBeFalsy('Expected no initial value.'); dispatchKeyboardEvent(select, 'keydown', RIGHT...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { const { control: formControl, select: selectInstance } = fixture.componentInstance; expect(selectInstance.panelOpen).toBe(false, 'Expected select to be closed.'); expect(formControl.value).toBeFalsy('Expected no initial value.'); ...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { const { control: formControl, select: selectInstance } = fixture.componentInstance; expect(selectInstance.panelOpen).toBe(false, 'Expected select to be closed.'); expect(formControl.value).toBeFalsy('Expected no initial value.'); ...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { const { select: selectInstance } = fixture.componentInstance; selectInstance.open(); expect(selectInstance.panelOpen).toBe(true, 'Expected select to be open.'); const event = createKeyboardEvent('keydown', DOWN_ARROW); ...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { const { select: selectInstance } = fixture.componentInstance; selectInstance.open(); expect(selectInstance.panelOpen).toBe(true, 'Expected select to be open.'); const event = createKeyboardEvent('keydown', UP_ARROW); ...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { const formControl = fixture.componentInstance.control; const options = fixture.componentInstance.options.toArray(); expect(formControl.value).toBeFalsy('Expected no initial value.'); dispatchEvent(select, createKeyboardEvent('key...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { fixture.destroy(); const multiFixture = TestBed.createComponent(MultiSelect); const instance = multiFixture.componentInstance; multiFixture.detectChanges(); select = multiFixture.debugEleme...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { fixture.destroy(); const multiFixture = TestBed.createComponent(MultiSelect); const instance = multiFixture.componentInstance; multiFixture.detectChanges(); select = multiFixture.debugEleme...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { fixture.destroy(); const multiFixture = TestBed.createComponent(MultiSelect); const instance = multiFixture.componentInstance; multiFixture.detectChanges(); select = multiFixture.debugElement.query(By.css('mc-...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { const formControl = fixture.componentInstance.control; expect(formControl.value).toBeNull('Expected form control value to be empty.'); expect(formControl.pristine).toBe(true, 'Expected form control to be clean.'); dispatchKeyboar...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { const formControl = fixture.componentInstance.control; formControl.setValue('eggs-5'); dispatchKeyboardEvent(select, 'keydown', DOWN_ARROW); expect(formControl.value).toBe('pasta-6'); expe...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { fixture.destroy(); const multiFixture = TestBed.createComponent(MultiSelect); multiFixture.detectChanges(); select = multiFixture.debugElement.query(By.css('mc-select')).nativeElement; multiFixture.componentIn...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { const formControl = fixture.componentInstance.control; formControl.setValue('eggs-5'); formControl.disable(); dispatchKeyboardEvent(select, 'keydown', DOWN_ARROW); expect(formControl.value).toBe('eggs-5', 'Ex...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { const lastOption = fixture.componentInstance.options.last; fixture.componentInstance.options.forEach(() => { dispatchKeyboardEvent(select, 'keydown', DOWN_ARROW); }); expect(lastOption.selected).toBe(true,...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { dispatchKeyboardEvent(select, 'keydown', DOWN_ARROW); }
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { fixture.destroy(); const multiFixture = TestBed.createComponent(MultiSelect); multiFixture.detectChanges(); select = multiFixture.debugElement.query(By.css('mc-select')).nativeElement; expect(multiFixture.com...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { fixture.destroy(); const multiFixture = TestBed.createComponent(MultiSelect); const event = createKeyboardEvent('keydown', DOWN_ARROW); Object.defineProperty(event, 'shiftKey', { get: () => true }); ...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { fixture.destroy(); const multiFixture = TestBed.createComponent(MultiSelect); const event = createKeyboardEvent('keydown', UP_ARROW); Object.defineProperty(event, 'shiftKey', { get: () => true }); ...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { const event = dispatchKeyboardEvent(select, 'keydown', SPACE); expect(event.defaultPrevented).toBe(true); }
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { const option = fixture.componentInstance.options.first; const spy = jasmine.createSpy('option selection spy'); const subscription = option.onSelectionChange.pipe(map((e) => e.isUserInput)).subscribe(spy); d...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
(e) => e.isUserInput
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { document.body.focus(); // ensure that focus isn't on the trigger already fixture.componentInstance.select.focus(); expect(document.activeElement).toBe(select, 'Expected select element to be focused.'); }
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { fixture.destroy(); const multiFixture = TestBed.createComponent(MultiSelect); const instance = multiFixture.componentInstance; multiFixture.detectChanges(); select = multiFixture.debugEleme...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { let fixture: ComponentFixture<BasicSelect>; let trigger: HTMLElement; let options: NodeListOf<HTMLElement>; beforeEach(fakeAsync(() => { fixture = TestBed.createComponent(BasicSelect); fixture.detectChanges...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { fixture = TestBed.createComponent(BasicSelect); fixture.detectChanges(); trigger = fixture.debugElement.query(By.css('.mc-select__trigger')).nativeElement; trigger.click(); fixture.detectChanges(); ...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { expect(options[0].getAttribute('tabindex')).toEqual('0'); expect(options[1].getAttribute('tabindex')).toEqual('0'); expect(options[2].getAttribute('tabindex')).toEqual('-1'); }
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { let fixture: ComponentFixture<BasicSelect>; let trigger: HTMLElement; beforeEach(fakeAsync(() => { fixture = TestBed.createComponent(BasicSelect); fixture.detectChanges(); trigger = fixture.debugElement.query(By.css('.mc-selec...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { fixture = TestBed.createComponent(BasicSelect); fixture.detectChanges(); trigger = fixture.debugElement.query(By.css('.mc-select__trigger')).nativeElement; }
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { // Create component and then immediately open without running change detection fixture = TestBed.createComponent(BasicSelect); expect(() => fixture.componentInstance.select.open()).not.toThrow(); }
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => fixture.componentInstance.select.open()
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript
ArrowFunction
() => { trigger.click(); fixture.detectChanges(); flush(); expect(fixture.componentInstance.select.panelOpen).toBe(true); expect(overlayContainerElement.textContent).toContain('Steak'); expect(overlayContainerElement.textC...
anywie/mosaic
packages/mosaic/select/select.component.spec.ts
TypeScript