angular/devtools/cypress/integration/comment-nodes.e2e.js
AleksanderBodurri 75d246e03c test(devtools): revive cypress tests (#61972)
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
2025-06-24 14:22:21 +00:00

31 lines
860 B
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
*/
function showComments() {
cy.get('#nav-buttons > button:nth-child(2)').click();
cy.get('.cdk-overlay-container mat-slide-toggle label:contains("Show comment nodes")').click();
}
describe('Comment nodes', () => {
beforeEach(() => {
cy.visit('/');
});
it('should not find any comment nodes by default', () => {
const nodes = cy.$$('ng-tree-node:contains("#comment")');
expect(nodes.length).to.eql(0);
});
it('should find comment nodes when the setting is enabled', () => {
showComments();
cy.get('.tree-wrapper')
.find('ng-tree-node:contains("#comment")')
.its('length')
.should('not.eq', 0);
});
});