Skip to content

Commit 5e39d03

Browse files
author
Samuel BERTHELOT
committed
added e2e test for custom content
1 parent a9ba2c3 commit 5e39d03

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/// <reference types="Cypress" />
2+
3+
context('Custom split content example page tests', () => {
4+
beforeEach(() => {
5+
cy.visit('/examples/custom-gutter-content')
6+
})
7+
8+
it('Verify gutter has custom label', () => {
9+
cy.wait(1000)
10+
cy.get('.custom-gutter-content').should('have.text', 'Custom label')
11+
})
12+
13+
it('Verify gutter custom label is updated', () => {
14+
cy.wait(1000)
15+
16+
cy.get('input:text').type(' updated')
17+
cy.get('.custom-gutter-content').should('have.text', 'Custom label updated')
18+
})
19+
20+
it('Verify gutter button is clicked', () => {
21+
cy.wait(1000)
22+
23+
const stub = cy.stub()
24+
cy.on('window:alert', stub)
25+
cy.get('.custom-gutter-content > input:button')
26+
.click()
27+
.then(() => {
28+
expect(stub.getCall(0)).to.be.calledWith('I was clicked')
29+
})
30+
})
31+
})

src/app/examples/custom-gutter-content/custom-gutter-content.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { AComponent } from '../../ui/components/AComponent'
1818
<ng-template #gutterTemplate>
1919
<div class="custom-gutter-container">
2020
<div class="custom-gutter-content">
21-
<span>{{ customLabel }} </span>
21+
<span>{{ customLabel }}</span>
2222
<input type="button" value="button" (click)="onClick()" />
2323
</div>
2424
</div>

0 commit comments

Comments
 (0)