mardi 15 août 2017

How do I test CSS transforms with NativeElement MdIcon in Angular 2

        .dropdown-icon
        {
            float: right;
            .mat-icon
            {

            }
            &.active
            {
                .mat-icon
                {
                    transform: rotate(90deg);
                    transition: transform .2s;
                }
            }
        }


    it('The submenu icon should be arrow to right ', () => {
        expect(iconEl.innerText).toContain('chevron_right');
    });

    it('The submenu is clicked and the icon should be dropdown', () => {
        component.opened = false;
        component.toggleMenu();
    });

Above is my code in component.scss file and one existing test . Basically I want to test if my icon rotates 90 degrees after I click on the submenu. I am having a hard time to track if the icon rotates 90 degrees. I am really appreciate for any advice and help!! Thanks

Aucun commentaire:

Enregistrer un commentaire