Skip to content

Add Examples for Testing Material UIs #32

@danapsimer

Description

@danapsimer

After adding material elements to my projects, all my tests that test components that utilize material directives failed with "is not a known element" error. Adding an import for "MaterialModule" and adding "MaterialModule" to the test module's "imports" fixes the problem but not for all tests. The app.component.spec.ts fails even with these imports with a DI error looking for something called "Overlay".

Also this fix seems wrong since these are supposed to be unit tests. Shouldn't we have a way to mock it out? I can't seem to find info on mocking the directives defined by the material.

Examples of how to do this properly would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions