angular / angular/components

A "Testing with Material Components" guide to demonstrate including core theme in test suite

Ouverte
#4,056 30 commentaires 41 réactions 0 personnes assignées Voir sur GitHub
area: material.angular.io docs feature help wanted P3
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

#### Bug, feature request, or proposal:
Bug or missing docs

#### What is the expected behavior?
Tests shouldn't log warnings after following the Getting Started guide on a fresh cli generated app.

#### Current behavior / steps to reproduce

1. Fresh cli app
2. Follow the getting started guide
3. Add an `md-card` component to AppComponent
4. Run unit tests
5. Resulting warning:

```
WARN: 'Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming'
Chrome 57.0.2987 (Mac OS X 10.12.4): Executed 0 of 3 SUCCESS (0 secs / 0 secs)
Chrome 57.0.2987 (Mac OS X 10.12.4): Executed 3 of 3 SUCCESS (0.226 secs / 0.199 secs)
```

#### Is there anything else we should know?
Modifying `karma.conf.js` to include a theme silenced the warning. This approach was borrowed from [Material's karma config](https://github.com/angular/material2/blob/master/test/karma.conf.js#L35-L36):

```
files: [
{ pattern: './src/test.ts', watched: false },
{ pattern: './node_modules/@angular/material/prebuilt-themes/indigo-pink.css' }
],
```

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Lisez le guide Getting Started et le karma.conf.js existant, puis comparez la configuration des tests avec la configuration karma de Material référencée et les étapes de création d’une application CLI vierge. Exécutez les tests unitaires après avoir ajouté md-card et vérifiez que l’avertissement core-theme a disparu, le guide devant documenter la configuration de test requise.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
documentation, testing
Type d'issue
Documentation
Difficulté
2/5
Temps estimé
1-3 heures
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.