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
|
|
|
*/
|
|
|
|
|
|
2021-04-28 22:50:06 +00:00
|
|
|
function showComments() {
|
2025-07-17 11:19:48 +00:00
|
|
|
cy.get('.main-toolbar > .settings > button:last-child').click();
|
2025-06-15 23:10:52 +00:00
|
|
|
cy.get('.cdk-overlay-container mat-slide-toggle + span:contains("Show comment nodes")').click();
|
2021-04-28 22:50:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
describe('Comment nodes', () => {
|
|
|
|
|
beforeEach(() => {
|
|
|
|
|
cy.visit('/');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should not find any comment nodes by default', () => {
|
2025-06-15 23:10:52 +00:00
|
|
|
const nodes = cy.$$('ng-tree-node:contains("#comment")');
|
2021-04-28 22:50:06 +00:00
|
|
|
expect(nodes.length).to.eql(0);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should find comment nodes when the setting is enabled', () => {
|
|
|
|
|
showComments();
|
2021-12-09 05:44:17 +00:00
|
|
|
cy.get('.tree-wrapper')
|
2025-06-15 23:10:52 +00:00
|
|
|
.find('ng-tree-node:contains("#comment")')
|
2021-12-09 05:44:17 +00:00
|
|
|
.its('length')
|
|
|
|
|
.should('not.eq', 0);
|
2021-04-28 22:50:06 +00:00
|
|
|
});
|
|
|
|
|
});
|