angular / angular/components

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

Aperta
#4,056 30 commenti 41 reazioni 0 assegnatari Vedi su GitHub
area: material.angular.io docs feature help wanted P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

#### 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' }
],
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Leggi la guida Getting Started e il karma.conf.js esistente, quindi confronta la configurazione dei test con la configurazione karma di Material indicata e i passaggi per una nuova app CLI. Esegui gli unit test dopo aver aggiunto md-card e verifica che l'avviso core-theme sia scomparso, facendo in modo che la guida documenti la configurazione dei test richiesta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
documentation, testing
Tipo di issue
Documentazione
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.