mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Previously these tests would run automatically when Angular DevTools lived in another repo. These files have continued to live here but have not been running automatically on each PR. Now, these test files have been revived to run properly with our changes since the repo merge. This is a first step to reviving our e2e testing. Next steps include writing cypress tests for new features like Injector Graph, Router tree, signals visualizations, etc. PR Close #61972
64 lines
2.3 KiB
JavaScript
64 lines
2.3 KiB
JavaScript
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.dev/license
|
|
*/
|
|
|
|
const prepareHeaderExpansionPanelForAssertions = (selector) => {
|
|
cy.get('.tree-wrapper').find(selector).first().click({force: true});
|
|
cy.get('.element-header .component-name').click();
|
|
};
|
|
|
|
describe('Viewing component metadata', () => {
|
|
beforeEach(() => {
|
|
cy.visit('/');
|
|
});
|
|
|
|
describe('viewing TodosComponent', () => {
|
|
beforeEach(() =>
|
|
prepareHeaderExpansionPanelForAssertions('ng-tree-node:contains("app-todos")'),
|
|
);
|
|
|
|
it('should display view encapsulation', () => {
|
|
cy.contains('.meta-data-container', 'View Encapsulation: None');
|
|
});
|
|
|
|
it('should display change detection strategy', () => {
|
|
cy.contains('.meta-data-container', 'Change Detection Strategy: Default');
|
|
});
|
|
});
|
|
|
|
describe('viewing DemoAppComponent', () => {
|
|
beforeEach(() =>
|
|
prepareHeaderExpansionPanelForAssertions('ng-tree-node:contains("app-demo-component")'),
|
|
);
|
|
|
|
it('should display view encapsulation', () => {
|
|
cy.contains('.meta-data-container', 'View Encapsulation: None');
|
|
});
|
|
|
|
it('should display change detection strategy', () => {
|
|
cy.contains('.meta-data-container', 'Change Detection Strategy: Default');
|
|
});
|
|
|
|
it('should display correct set of inputs', () => {
|
|
cy.contains('.mat-accordion-content#Inputs', 'Inputs');
|
|
cy.contains('.mat-accordion-content#Inputs mat-tree-node:first span:first', 'inputOne');
|
|
cy.contains('.mat-accordion-content#Inputs mat-tree-node:last span:first', 'inputTwo');
|
|
});
|
|
|
|
it('should display correct set of outputs', () => {
|
|
cy.contains('.mat-accordion-content#Outputs', 'Outputs');
|
|
cy.contains('.mat-accordion-content#Outputs mat-tree-node:first span:first', 'outputOne');
|
|
cy.contains('.mat-accordion-content#Outputs mat-tree-node:last span:first', 'outputTwo');
|
|
});
|
|
|
|
it('should display correct set of properties', () => {
|
|
cy.contains('.mat-accordion-content#Properties', 'Properties');
|
|
cy.contains('.mat-accordion-content#Properties mat-tree-node:first span:first', 'elementRef');
|
|
cy.contains('.mat-accordion-content#Properties mat-tree-node:last span:first', 'zippy');
|
|
});
|
|
});
|
|
});
|