2021-12-10 02:37:01 +00:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright Google LLC All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
2024-09-20 15:23:15 +00:00
|
|
|
* found in the LICENSE file at https://angular.dev/license
|
2021-12-10 02:37:01 +00:00
|
|
|
*/
|
|
|
|
|
|
2020-04-21 18:47:47 +00:00
|
|
|
const prepareHeaderExpansionPanelForAssertions = (selector) => {
|
2021-12-09 05:44:17 +00:00
|
|
|
cy.get('.tree-wrapper').find(selector).first().click({force: true});
|
2020-04-21 18:47:47 +00:00
|
|
|
cy.get('.element-header .component-name').click();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
describe('Viewing component metadata', () => {
|
|
|
|
|
beforeEach(() => {
|
|
|
|
|
cy.visit('/');
|
|
|
|
|
});
|
|
|
|
|
|
2025-06-15 23:10:52 +00:00
|
|
|
describe('viewing TodosComponent', () => {
|
2021-12-09 05:44:17 +00:00
|
|
|
beforeEach(() =>
|
2025-06-15 23:10:52 +00:00
|
|
|
prepareHeaderExpansionPanelForAssertions('ng-tree-node:contains("app-todos")'),
|
2021-12-09 05:44:17 +00:00
|
|
|
);
|
2020-04-21 18:47:47 +00:00
|
|
|
|
2021-12-10 02:37:01 +00:00
|
|
|
it('should display view encapsulation', () => {
|
2025-06-15 23:10:52 +00:00
|
|
|
cy.contains('ng-component-metadata', 'View Encapsulation: None');
|
2021-12-10 02:37:01 +00:00
|
|
|
});
|
2020-04-21 18:47:47 +00:00
|
|
|
|
2021-12-10 02:37:01 +00:00
|
|
|
it('should display change detection strategy', () => {
|
2025-06-15 23:10:52 +00:00
|
|
|
cy.contains('ng-component-metadata', 'Change Detection Strategy: Default');
|
2021-12-10 02:37:01 +00:00
|
|
|
});
|
2020-04-21 18:47:47 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
describe('viewing DemoAppComponent', () => {
|
2021-12-09 05:44:17 +00:00
|
|
|
beforeEach(() =>
|
2025-06-15 23:10:52 +00:00
|
|
|
prepareHeaderExpansionPanelForAssertions('ng-tree-node:contains("app-demo-component")'),
|
2021-12-09 05:44:17 +00:00
|
|
|
);
|
2020-04-21 18:47:47 +00:00
|
|
|
|
2021-12-10 02:37:01 +00:00
|
|
|
it('should display view encapsulation', () => {
|
2025-06-15 23:10:52 +00:00
|
|
|
cy.contains('ng-component-metadata', 'View Encapsulation: None');
|
2021-12-10 02:37:01 +00:00
|
|
|
});
|
2020-04-21 18:47:47 +00:00
|
|
|
|
2021-12-10 02:37:01 +00:00
|
|
|
it('should display change detection strategy', () => {
|
2025-06-15 23:10:52 +00:00
|
|
|
cy.contains('ng-component-metadata', 'Change Detection Strategy: Default');
|
2021-12-10 02:37:01 +00:00
|
|
|
});
|
2021-06-02 03:40:38 +00:00
|
|
|
|
|
|
|
|
it('should display correct set of inputs', () => {
|
2025-06-15 23:10:52 +00:00
|
|
|
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');
|
2021-06-02 03:40:38 +00:00
|
|
|
});
|
2021-12-09 05:44:17 +00:00
|
|
|
|
2021-06-02 03:40:38 +00:00
|
|
|
it('should display correct set of outputs', () => {
|
2025-06-15 23:10:52 +00:00
|
|
|
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');
|
2021-06-02 03:40:38 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should display correct set of properties', () => {
|
2025-06-15 23:10:52 +00:00
|
|
|
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');
|
2021-06-02 03:40:38 +00:00
|
|
|
});
|
2020-04-21 18:47:47 +00:00
|
|
|
});
|
|
|
|
|
});
|