type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
taskData => {} | nliebhartbellevue/nodebucket | src/app/task/task.service.ts | TypeScript |
ArrowFunction |
() => {
const updatedTasks = this.tasks.filter(t => t._id !== task._id);
this.tasks = updatedTasks;
this.tasksUpdated.next({
tasks: [...this.tasks]
});
this.router.navigate(['/']);
} | nliebhartbellevue/nodebucket | src/app/task/task.service.ts | TypeScript |
ArrowFunction |
t => t._id !== task._id | nliebhartbellevue/nodebucket | src/app/task/task.service.ts | TypeScript |
ClassDeclaration |
@Injectable({
providedIn: 'root'
})
export class TaskService {
constructor(
private http: HttpClient,
private router: Router,
private authService: AuthService
) {}
private tasks: Task[] = [];
private tasksUpdated = new Subject<{ tasks: Task[] }>();
private baseUrl = 'api/v2/task';
private boa... | nliebhartbellevue/nodebucket | src/app/task/task.service.ts | TypeScript |
InterfaceDeclaration |
export interface Step {
id: string;
title: string;
tasks: Task[];
} | nliebhartbellevue/nodebucket | src/app/task/task.service.ts | TypeScript |
InterfaceDeclaration |
export interface Board {
steps: Step[];
} | nliebhartbellevue/nodebucket | src/app/task/task.service.ts | TypeScript |
MethodDeclaration |
getBoards(): Board[] {
return this.boards$;
} | nliebhartbellevue/nodebucket | src/app/task/task.service.ts | TypeScript |
MethodDeclaration |
getTasks() {
this.http
.get<{ message: string; tasks: any }>(`${this.baseUrl}`)
.pipe(
map(taskData => {
return taskData.tasks.map(task => {
return {
title: task.title,
content: task.content,
status: task.status,
assi... | nliebhartbellevue/nodebucket | src/app/task/task.service.ts | TypeScript |
MethodDeclaration |
getEmpTask(assigned: string) {
this.http
.get<{ message: string; tasks: any }>(
`${this.baseUrl}/emptask/${assigned}`
)
.pipe(
map(taskData => {
return taskData.tasks.map(task => {
return {
_id: task._id,
title: task.title,
... | nliebhartbellevue/nodebucket | src/app/task/task.service.ts | TypeScript |
MethodDeclaration |
getTaskUpdateListener() {
return this.tasksUpdated.asObservable();
} | nliebhartbellevue/nodebucket | src/app/task/task.service.ts | TypeScript |
MethodDeclaration |
getTask(id: string) {
return this.http.get<{
_id: string;
title: string;
content: string;
status: string;
assignedTo: string;
createdBy: string;
lastModifiedBy: string;
}>(`${this.baseUrl}/_id`);
} | nliebhartbellevue/nodebucket | src/app/task/task.service.ts | TypeScript |
MethodDeclaration |
addTask(
title: string,
content: string,
assignedTo: string,
createdBy: string,
status: string
) {
const task: Task = {
_id: null,
title,
content,
status,
assignedTo,
createdBy: this.authService.getEmpid()
};
this.http
.post<{ message: string;... | nliebhartbellevue/nodebucket | src/app/task/task.service.ts | TypeScript |
MethodDeclaration |
updateTask(task: Task) {
console.log(task._id);
this.http.put(`${this.baseUrl}/` + task._id, task).subscribe(
response => {
if (response) {
console.log(response);
const updatedTasks = [...this.tasks];
const oldTaskIndex = updatedTasks.findIndex(t => t._id === task._i... | nliebhartbellevue/nodebucket | src/app/task/task.service.ts | TypeScript |
MethodDeclaration |
updateTaskStatus(task: Task) {
this.http
.patch<{ message: string; task: Task }>(
`${this.baseUrl}/task.id`,
task
)
.subscribe(taskData => {});
console.log(task._id);
} | nliebhartbellevue/nodebucket | src/app/task/task.service.ts | TypeScript |
MethodDeclaration |
deleteTask(task: Task) {
this.http.delete(`${this.baseUrl}/` + task._id).subscribe(() => {
const updatedTasks = this.tasks.filter(t => t._id !== task._id);
this.tasks = updatedTasks;
this.tasksUpdated.next({
tasks: [...this.tasks]
});
this.router.navigate(['/']);
});
} | nliebhartbellevue/nodebucket | src/app/task/task.service.ts | TypeScript |
ClassDeclaration |
@Entity()
export class Todo {
@PrimaryGeneratedColumn()
id: number
@Column()
content: string
@Column()
title: string
@Column()
done: boolean
@CreateDateColumn()
createdAt: Date
@UpdateDateColumn()
updateAt: Date
} | y0c/nest | src/modules/todo/entity/Todo.ts | TypeScript |
ArrowFunction |
theme => ({
root: { position: "fixed", left: 0, right: 0, top: 0, bottom: 0 },
canvas: { width: "100%", height: "100%" }
}) | K024/bangbangboom-editor | src/GamePage/index.tsx | TypeScript |
ArrowFunction |
() => {
const cn = useStyles()
const container = useRef<HTMLDivElement>(null)
const canvas = useRef<HTMLCanvasElement>(null)
useEffect(() => {
if (!canvas.current) return
if (!Music.musicfile) {
window.history.back()
setTimeout(() => {
userMessage(i18n.t("No music selected"))
... | K024/bangbangboom-editor | src/GamePage/index.tsx | TypeScript |
ArrowFunction |
() => {
if (!canvas.current) return
if (!Music.musicfile) {
window.history.back()
setTimeout(() => {
userMessage(i18n.t("No music selected"))
}, 100)
return
}
const musicSrc = URL.createObjectURL(Music.musicfile)
const game = new Game(canvas.current, {
judgeOff... | K024/bangbangboom-editor | src/GamePage/index.tsx | TypeScript |
ArrowFunction |
() => {
userMessage(i18n.t("No music selected"))
} | K024/bangbangboom-editor | src/GamePage/index.tsx | TypeScript |
ArrowFunction |
() => toGameContent(scope.map as any) | K024/bangbangboom-editor | src/GamePage/index.tsx | TypeScript |
ArrowFunction |
() => {
window.history.back()
} | K024/bangbangboom-editor | src/GamePage/index.tsx | TypeScript |
ArrowFunction |
() => {
URL.revokeObjectURL(musicSrc)
} | K024/bangbangboom-editor | src/GamePage/index.tsx | TypeScript |
InterfaceDeclaration | /**
* @license
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ... | Andrea-MariaDB/firebase-js-sdk | packages-exp/messaging-exp/src/interfaces/token-details.ts | TypeScript |
InterfaceDeclaration | /**
* Additional options and values required by a Push API subscription.
*/
export interface SubscriptionOptions {
vapidKey: string;
swScope: string;
endpoint: string;
auth: string;
p256dh: string;
} | Andrea-MariaDB/firebase-js-sdk | packages-exp/messaging-exp/src/interfaces/token-details.ts | TypeScript |
FunctionDeclaration |
export default function autoCssModulesHandler(
opts: IEsbuildLoaderHandlerParams,
) {
let { code } = opts;
let offset = 0;
opts.imports.forEach((i) => {
if (i.d < 0 && isStyleFile({ filename: i.n })) {
// import x from './index.less'
// => import x from '
const importSegment = code.sub... | 1247748612/umi-next | packages/bundler-webpack/src/esbuildHandler/autoCssModules.ts | TypeScript |
ArrowFunction |
(i) => {
if (i.d < 0 && isStyleFile({ filename: i.n })) {
// import x from './index.less'
// => import x from '
const importSegment = code.substring(i.ss + offset, i.s + offset);
// is css module
if (~importSegment.indexOf(' from')) {
code = `${code.substring(
0,
... | 1247748612/umi-next | packages/bundler-webpack/src/esbuildHandler/autoCssModules.ts | TypeScript |
ClassDeclaration |
export default class ClaimKeybase extends ClaimCommand {
static description = 'Claim a keybase username and add the claim to a local metadata file'
static flags = {
...ClaimCommand.flags,
username: flags.string({
required: true,
description: 'The keybase username you want to claim',
}),
}... | 0xruff/celo-monorepo | packages/cli/src/commands/account/claim-keybase.ts | TypeScript |
MethodDeclaration |
async run() {
const res = this.parse(ClaimKeybase)
const username = res.flags.username
const metadata = await this.readMetadata()
const accountAddress = toChecksumAddress(metadata.data.meta.address)
const claim = createKeybaseClaim(username)
const signature = await this.signer.sign(hashOfClaim(... | 0xruff/celo-monorepo | packages/cli/src/commands/account/claim-keybase.ts | TypeScript |
MethodDeclaration |
async attemptAutomaticProofUpload(
claim: KeybaseClaim,
signature: string,
username: string,
address: string
) {
const signedClaim = { claim, signature }
try {
cli.action.start(`Attempting to automate keybase proof`)
const publicFolderPrefix = `/keybase/public/${username}/`
... | 0xruff/celo-monorepo | packages/cli/src/commands/account/claim-keybase.ts | TypeScript |
MethodDeclaration |
async uploadProof(claim: KeybaseClaim, signature: string, username: string, address: string) {
try {
if (
(await commandExists('keybase')) &&
(await binaryPrompt(
`Found keybase CLI. Do you want me to attempt to publish the claim onto the keybase fs?`
))
) {
aw... | 0xruff/celo-monorepo | packages/cli/src/commands/account/claim-keybase.ts | TypeScript |
MethodDeclaration |
printManualInstruction(
claim: KeybaseClaim,
signature: string,
username: string,
address: string
) {
const fileName = proofFileName(address)
writeFileSync(fileName, JSON.stringify({ claim, signature }))
console.info(
`\nProving a keybase claim requires you to publish the signed cla... | 0xruff/celo-monorepo | packages/cli/src/commands/account/claim-keybase.ts | TypeScript |
MethodDeclaration |
async ensureKeybaseFilePathToProof(base: string) {
const segments = keybaseFilePathToProof.split('/')
let currentPath = base
for (let i = 0; i < segments.length - 1; i++) {
currentPath += segments[i] + '/'
if (!(await execWith0Exit('keybase', ['fs', 'ls', currentPath], { silent: true }))) {
... | 0xruff/celo-monorepo | packages/cli/src/commands/account/claim-keybase.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class PostsService {
constructor(
@InjectModel('Post')
private readonly postModel: Model<PostInterface>,
private readonly userService: UsersService,
private readonly promotionService: PromotionsService,
) {
}
// TODO:: handle exceptions using try-catch bloc... | Hybeecodes/startup-club | src/posts/posts.service.ts | TypeScript |
MethodDeclaration | // TODO:: handle exceptions using try-catch blocks (something like return error: error.message)
async findAll(): Promise<PostInterface[]> {
return await this.postModel.find().exec();
} | Hybeecodes/startup-club | src/posts/posts.service.ts | TypeScript |
MethodDeclaration |
async findUserPosts(userId: string) {
return await this.postModel.find({ author: userId }).exec();
} | Hybeecodes/startup-club | src/posts/posts.service.ts | TypeScript |
MethodDeclaration |
async findById(id: string): Promise<PostInterface | undefined> {
const post = await this.postModel.findById(id).exec();
if (!post) {
throw new NotFoundException('Post doesn\'t exist');
}
return post;
} | Hybeecodes/startup-club | src/posts/posts.service.ts | TypeScript |
MethodDeclaration |
async findBySlug(slug: string): Promise<PostInterface | undefined> {
const post = await this.postModel.findOne({ slug }).exec();
if (!post) {
throw new NotFoundException('Post doesn\'t exist');
}
return post;
} | Hybeecodes/startup-club | src/posts/posts.service.ts | TypeScript |
MethodDeclaration |
async create(postData, id: string): Promise<PostInterface | undefined> {
let newPost = new this.postModel(postData);
newPost.author = id;
newPost.slug = `${newPost.title.replace(/ /g, '_')}_${Date.now().toString()}`;
newPost = await newPost.save();
if (!newPost) {
th... | Hybeecodes/startup-club | src/posts/posts.service.ts | TypeScript |
MethodDeclaration |
async update(postData: CreatePostDto, id: string): Promise<PostInterface | undefined> {
const post = await this.postModel.findById(id);
if (!post) {
throw new NotFoundException('Post doesn\'t exist');
}
post.body = postData.body;
post.title = postData.title;
... | Hybeecodes/startup-club | src/posts/posts.service.ts | TypeScript |
MethodDeclaration |
async delete(id: string) {
const deleted = this.postModel.findByIdAndRemove(id);
if (!deleted) {
throw new InternalServerErrorException('Unable to delete post');
}
return deleted;
} | Hybeecodes/startup-club | src/posts/posts.service.ts | TypeScript |
MethodDeclaration |
async promote(postId: string, medium: string, userId: string) {
if (!medium) {
throw new BadRequestException('Promotion medium is required');
}
// create promotion
const promotion = await this.promotionService.new({
postId,
promoter: userId,
... | Hybeecodes/startup-club | src/posts/posts.service.ts | TypeScript |
MethodDeclaration |
async getPromotionBasedPosts(): Promise<PostInterface[]> {
try {
return await this.postModel
.find()
.populate('author', ['firstname', 'lastname', 'promotions'])
.sort({ 'author.promotions': 'desc' })
.exec();
} catch (error) {
... | Hybeecodes/startup-club | src/posts/posts.service.ts | TypeScript |
ArrowFunction |
() => 0.5 - Math.random() | mockoon/mockoon.com | pages/index.tsx | TypeScript |
ArrowFunction |
(logo, logoIndex) => (
<div
key={`logo${logoIndex}` | mockoon/mockoon.com | pages/index.tsx | TypeScript |
ArrowFunction |
(highlight, highlightIndex) => (
<div
className='col-12 col-md-4' | mockoon/mockoon.com | pages/index.tsx | TypeScript |
ArrowFunction |
(feature, featureIndex) => {
return (
<div
className='row py-5 py-lg-8 align-items-center justify-content-between'
key={`feature${featureIndex}`} | mockoon/mockoon.com | pages/index.tsx | TypeScript |
ArrowFunction |
(testimonial, testimonialIndex) => {
return (
testimonialIndex > 0 && (
<div
className='col-md-6 col-lg-4 col-xl-3 d-flex text-center'
key={`testimonial${testimonialIndex}`} | mockoon/mockoon.com | pages/index.tsx | TypeScript |
ClassDeclaration |
class Index extends React.Component<{}, { companyLogos: any }> {
constructor(props) {
super(props);
this.state = { companyLogos };
}
componentDidMount() {
// ensure that random things are on client only
this.setState({
companyLogos: companyLogos.sort(() => 0.5 - Math.random())
});
}
... | mockoon/mockoon.com | pages/index.tsx | TypeScript |
MethodDeclaration |
componentDidMount() {
// ensure that random things are on client only
this.setState({
companyLogos: companyLogos.sort(() => 0.5 - Math.random())
});
} | mockoon/mockoon.com | pages/index.tsx | TypeScript |
MethodDeclaration |
render() {
return (
<Layout>
<Meta title={meta.title} description={meta.description} />
<Hero
title="Create <span className='text-primary'>mock APIs</span> in seconds"
subtitle='Mockoon is the easiest and quickest way to design and run mock REST APIs.<br>No remote deploym... | mockoon/mockoon.com | pages/index.tsx | TypeScript |
FunctionDeclaration |
function initSidebar() {
selectAll("aside a").forEach(el => {
el.classList.remove("selected");
const href = el.getAttribute("href");
if (href && href.includes(window.location.pathname)) {
el.classList.add("selected");
}
});
const errors = select("#data-error-count").value;
select("aside l... | kiney/fava | fava/static/javascript/sidebar.ts | TypeScript |
ArrowFunction |
el => {
el.classList.remove("selected");
const href = el.getAttribute("href");
if (href && href.includes(window.location.pathname)) {
el.classList.add("selected");
}
} | kiney/fava | fava/static/javascript/sidebar.ts | TypeScript |
ArrowFunction |
() => {
const asideButton = select("#aside-button");
asideButton.addEventListener("click", () => {
select("aside").classList.toggle("active");
asideButton.classList.toggle("active");
});
} | kiney/fava | fava/static/javascript/sidebar.ts | TypeScript |
ArrowFunction |
() => {
select("aside").classList.toggle("active");
asideButton.classList.toggle("active");
} | kiney/fava | fava/static/javascript/sidebar.ts | TypeScript |
ArrowFunction |
() => {
initSidebar();
} | kiney/fava | fava/static/javascript/sidebar.ts | TypeScript |
ArrowFunction |
() => {
fetchAPI("errors").then(errors => {
select("#data-error-count").value = errors;
initSidebar();
});
} | kiney/fava | fava/static/javascript/sidebar.ts | TypeScript |
ArrowFunction |
errors => {
select("#data-error-count").value = errors;
initSidebar();
} | kiney/fava | fava/static/javascript/sidebar.ts | TypeScript |
MethodDeclaration |
quickSearchListItem(itemName: string, itemType: string): string {
return `[data-test="item-name-${itemName}-${itemType}"]`;
} | yaacov/web-ui | frontend/packages/dev-console/integration-tests/support/pageObjects/add-flow-po.ts | TypeScript |
ArrowFunction |
({ card, onFinish }: Props) => {
const { feature } = card;
const [isOpen, openModal] = useState(false);
const { getAllModules, loading, allModules } = useModules();
useEffect(() => {
if (allModules) openModal(true);
}, [allModules]);
const handleClose = () => {
openModal(false);
onFinish();
... | Rossalli/charlescd | ui/src/modules/Hypotheses/Board/Card/View/Layers/Modules/index.tsx | TypeScript |
ArrowFunction |
() => {
if (allModules) openModal(true);
} | Rossalli/charlescd | ui/src/modules/Hypotheses/Board/Card/View/Layers/Modules/index.tsx | TypeScript |
ArrowFunction |
() => {
openModal(false);
onFinish();
} | Rossalli/charlescd | ui/src/modules/Hypotheses/Board/Card/View/Layers/Modules/index.tsx | TypeScript |
ArrowFunction |
() =>
feature?.modules && (
<Panel.Content>
{map(feature?.modules, ({ name }) | Rossalli/charlescd | ui/src/modules/Hypotheses/Board/Card/View/Layers/Modules/index.tsx | TypeScript |
InterfaceDeclaration |
interface Props {
card: Card;
onFinish: Function;
} | Rossalli/charlescd | ui/src/modules/Hypotheses/Board/Card/View/Layers/Modules/index.tsx | TypeScript |
MethodDeclaration |
map(feature?.modules, | Rossalli/charlescd | ui/src/modules/Hypotheses/Board/Card/View/Layers/Modules/index.tsx | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({
imports: [BidiModule, NzMenuModule, NoopAnimationsModule, NzIconTestModule],
declarations: [
NzTestBasicMenuHorizontalComponent,
NzTestBasicMenuInlineComponent,
NzTestMenuInlineCollapsedComponent,
NzTestMenuSiderCurr... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
(oc: OverlayContainer) => {
overlayContainer = oc;
overlayContainerElement = oc.getContainerElement();
} | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
(currentOverlayContainer: OverlayContainer) => {
currentOverlayContainer.ngOnDestroy();
overlayContainer.ngOnDestroy();
} | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
let fixture: ComponentFixture<NzTestBasicMenuHorizontalComponent>;
let items: DebugElement[];
let submenu: DebugElement;
let menu: DebugElement;
beforeEach(() => {
fixture = TestBed.createComponent(NzTestBasicMenuHorizontalComponent);
items = fixture.debugElement.q... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(NzTestBasicMenuHorizontalComponent);
items = fixture.debugElement.queryAll(By.directive(NzMenuItemDirective));
submenu = fixture.debugElement.query(By.directive(NzSubMenuComponent));
menu = fixture.debugElement.query(By.directive(NzMenuDirective... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
expect(items.every(item => item.nativeElement.classList.contains('ant-menu-item'))).toBe(true);
expect(items[1].nativeElement.classList.contains('ant-menu-item-disabled')).toBe(true);
expect(submenu.nativeElement.classList.contains('ant-menu-submenu-hori... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
item => item.nativeElement.classList.contains('ant-menu-item') | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
items[0].nativeElement.click();
fixture.detectChanges();
expect(items[0].nativeElement.classList.contains('ant-menu-item-selected')).toBe(true);
} | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
items[1].nativeElement.click();
fixture.detectChanges();
expect(items[0].nativeElement.classList.contains('ant-menu-item-selected')).toBe(false);
} | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
expect(items[3].nativeElement.classList.contains('ant-menu-item-danger')).toBe(true);
} | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
let fixture: ComponentFixture<NzTestBasicMenuInlineComponent>;
let items: DebugElement[];
let submenus: DebugElement[];
let menu: DebugElement;
beforeEach(() => {
fixture = TestBed.createComponent(NzTestBasicMenuInlineComponent);
items = fixture.debugElement.queryA... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(NzTestBasicMenuInlineComponent);
items = fixture.debugElement.queryAll(By.directive(NzMenuItemDirective));
menu = fixture.debugElement.query(By.directive(NzMenuDirective));
submenus = fixture.debugElement.queryAll(By.directive(NzSubMenuComponent... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
expect(submenus.every(subitem => subitem.nativeElement.classList.contains('ant-menu-submenu'))).toBe(true);
expect(submenus.every(subitem => subitem.nativeElement.classList.contains('ant-menu-submenu-inline'))).toBe(
true
);
expect(menu... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
subitem => subitem.nativeElement.classList.contains('ant-menu-submenu') | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
subitem => subitem.nativeElement.classList.contains('ant-menu-submenu-inline') | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
const firstLevelItems = items;
const secondLevelItems = firstLevelItems.splice(6, 2);
expect(firstLevelItems.every(item => item.nativeElement.style.paddingLeft === '48px')).toBe(true);
expect(secondLevelItems.every(item => item.nativeElement.styl... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
item => item.nativeElement.style.paddingLeft === '48px' | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
item => item.nativeElement.style.paddingLeft === '72px' | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
const ul = submenus[0].nativeElement.querySelector('.ant-menu');
const title = submenus[0].nativeElement.querySelector('.ant-menu-submenu-title');
expect(ul.style.height).toBe('0px');
title.click();
fixture.detectChanges();
tick(5... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
let fixture: ComponentFixture<NzTestMenuInlineCollapsedComponent>;
let testComponent: NzTestMenuInlineCollapsedComponent;
let submenus: DebugElement[];
let menu: DebugElement;
beforeEach(() => {
fixture = TestBed.createComponent(NzTestMenuInlineCollapsedComponent);
... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(NzTestMenuInlineCollapsedComponent);
testComponent = fixture.debugElement.componentInstance;
submenus = fixture.debugElement.queryAll(By.directive(NzSubMenuComponent));
menu = fixture.debugElement.query(By.directive(NzMenuDirective));
} | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
expect(menu.nativeElement.className).toBe('ant-menu ant-menu-root ant-menu-dark ant-menu-inline');
testComponent.isCollapsed = true;
fixture.detectChanges();
expect(menu.nativeElement.className).toBe(
'ant-menu ant-menu-root ant-menu-da... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
let ul = submenus[0].nativeElement.querySelector('.ant-menu');
const title = submenus[0].nativeElement.querySelector('.ant-menu-submenu-title');
expect(ul.style.height).toBe('0px');
testComponent.isCollapsed = true;
fixture.detectChanges(... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
let fixture: ComponentFixture<NzTestMenuSiderCurrentComponent>;
let submenus: DebugElement[];
beforeEach(() => {
fixture = TestBed.createComponent(NzTestMenuSiderCurrentComponent);
submenus = fixture.debugElement.queryAll(By.directive(NzSubMenuComponent));
});
it('... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(NzTestMenuSiderCurrentComponent);
submenus = fixture.debugElement.queryAll(By.directive(NzSubMenuComponent));
} | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
const ul = submenus[0].nativeElement.querySelector('.ant-menu');
const title = submenus[0].nativeElement.querySelector('.ant-menu-submenu-title');
expect(ul.style.height).not.toBe('0px');
title.click();
fixture.detectChanges();
ti... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
const firstUl = submenus[0].nativeElement.querySelector('.ant-menu');
const secondUl = submenus[1].nativeElement.querySelector('.ant-menu');
const secondTitle = submenus[1].nativeElement.querySelector('.ant-menu-submenu-title');
expect(firstUl.st... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
let fixture: ComponentFixture<NzTestMenuThemeComponent>;
let testComponent: NzTestMenuThemeComponent;
let menu: DebugElement;
beforeEach(() => {
fixture = TestBed.createComponent(NzTestMenuThemeComponent);
testComponent = fixture.debugElement.componentInstance;
m... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(NzTestMenuThemeComponent);
testComponent = fixture.debugElement.componentInstance;
menu = fixture.debugElement.query(By.directive(NzMenuDirective));
} | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
expect(menu.nativeElement.className).toBe('ant-menu ant-menu-root ant-menu-dark ant-menu-inline');
testComponent.theme = false;
fixture.detectChanges();
expect(menu.nativeElement.className).toBe('ant-menu ant-menu-root ant-menu-inline ant-menu-li... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
let fixture: ComponentFixture<NzTestMenuSwitchModeComponent>;
let testComponent: NzTestMenuSwitchModeComponent;
let submenus: DebugElement[];
let menu: DebugElement;
beforeEach(() => {
fixture = TestBed.createComponent(NzTestMenuSwitchModeComponent);
testComponent ... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(NzTestMenuSwitchModeComponent);
testComponent = fixture.debugElement.componentInstance;
submenus = fixture.debugElement.queryAll(By.directive(NzSubMenuComponent));
menu = fixture.debugElement.query(By.directive(NzMenuDirective));
} | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
expect(menu.nativeElement.className).toBe('ant-menu ant-menu-root ant-menu-light ant-menu-inline');
expect(submenus.every(submenu => submenu.nativeElement.classList.contains('ant-menu-submenu-inline'))).toBe(
true
);
testComponent.mode ... | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
submenu => submenu.nativeElement.classList.contains('ant-menu-submenu-inline') | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
ArrowFunction |
submenu => submenu.nativeElement.classList.contains('ant-menu-submenu-vertical') | chriso86/ng-zorro-antd | components/menu/menu.spec.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.