mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
afb0ee37eb
Removes the screenshot test tool since Angular Material is visually being tested inside of Google.
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import {browser, by, element} from 'protractor';
|
|
|
|
describe('expansion', () => {
|
|
|
|
beforeEach(() => browser.get('/expansion'));
|
|
|
|
it('should show an accordion', async () => {
|
|
expect(element(by.css('.mat-accordion'))).toBeDefined();
|
|
});
|
|
|
|
it('should show two panels', async () => {
|
|
expect(await element.all(by.css('.mat-expansion-panel')).count()).toBe(2);
|
|
});
|
|
|
|
it('should hide contents of the expansion panel on click', async () => {
|
|
const panelHeader = element.all(by.css('.mat-expansion-panel-header')).get(0);
|
|
const panelContent = element.all(by.css('.mat-expansion-panel-content')).get(0);
|
|
|
|
expect(await panelContent.isDisplayed()).toBe(false);
|
|
|
|
panelHeader.click();
|
|
|
|
expect(await panelContent.isDisplayed()).toBe(true);
|
|
});
|
|
|
|
it('should emit events for expanding and collapsing', async () => {
|
|
const panelHeader = element.all(by.css('.mat-expansion-panel-header')).get(1);
|
|
const panelDescription = element
|
|
.all(by.css('.mat-expansion-panel-header mat-panel-description')).get(1);
|
|
|
|
panelHeader.click();
|
|
|
|
expect(panelDescription.getText()).toContain('Currently I am open');
|
|
|
|
panelHeader.click();
|
|
|
|
expect(panelDescription.getText()).toContain('Currently I am closed');
|
|
});
|
|
|
|
});
|
|
|