Helpers and examples for unit testing on Angular applications and libraries.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { | |
Link as RouterLink, | |
LinkProps as RouterLinkProps | |
} from 'react-router-dom' | |
import MuiLink, { LinkProps as MuiLinkProps } from '@material-ui/core/Link' | |
export type LinkProps = MuiLinkProps & Pick<RouterLinkProps, 'to' | 'replace'> | |
const createLink: React.FC<LinkProps> = ({ innerRef, ...rest }) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Injectable} from '@angular/core'; | |
import {DateAdapter} from '@angular/material'; | |
import {addDays, addMonths, addYears, format, getDate, getDaysInMonth, getMonth, getYear, parse, setDay, setMonth, toDate} from 'date-fns'; | |
// CONFIG. Use environment or something for a dynamic locale and settings | |
import {es as locale} from 'date-fns/locale'; | |
const WEEK_STARTS_ON = 1; // 0 sunday, 1 monday... | |
export const MAT_DATE_FNS_DATE_FORMATS = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, Injectable, Directive, TemplateRef } from '@angular/core'; | |
import { NgbModal, NgbModalRef, NgbModalOptions } from '@ng-bootstrap/ng-bootstrap'; | |
/** | |
* Options passed when opening a confirmation modal | |
*/ | |
interface ConfirmOptions { | |
/** | |
* The title of the confirmation modal | |
*/ |