-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jwa(front): Add e2e tests for volume's mount path input
Signed-off-by: Tasos Alexiou <tasos@arrikto.com>
- Loading branch information
Tasos Alexiou
committed
Jan 5, 2023
1 parent
d4aef49
commit 187b362
Showing
4 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
components/crud-web-apps/jupyter/frontend/cypress/integration/form-page.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
describe('New notebook form', () => { | ||
beforeEach(() => {}); | ||
|
||
it('should have a "New notebook" title', () => { | ||
cy.visit('/new'); | ||
cy.get('[data-cy-toolbar-title]').contains('New notebook').should('exist'); | ||
}); | ||
|
||
it('should auto update mount value when name change', () => { | ||
cy.get('[data-cy="add new volume"]').click(); | ||
|
||
cy.get('.last[data-cy="data volumes"]').click(); | ||
|
||
cy.get('.last[data-cy="data volumes"]') | ||
.find('[data-cy="volume name input"]') | ||
.type('new-volume-name') | ||
.then($nameInput => { | ||
const nameValue = $nameInput.val(); | ||
cy.get('.last[data-cy="data volumes"]') | ||
.find('[data-cy="mount path"]') | ||
.should($mountInput => { | ||
const mountValue = $mountInput.val(); | ||
expect(mountValue).equal(`/home/jovyan/${nameValue}`); | ||
}); | ||
}); | ||
}); | ||
|
||
it('should not auto update mount value when it is dirty', () => { | ||
cy.get('[data-cy="add new volume"]').click(); | ||
|
||
cy.get('.last[data-cy="data volumes"]').click(); | ||
|
||
cy.get('.last[data-cy="data volumes"]') | ||
.find('[data-cy="mount path"]') | ||
.type('dirty'); | ||
|
||
cy.get('.last[data-cy="data volumes"]') | ||
.find('[data-cy="volume name input"]') | ||
.type('new-volume-name') | ||
.then($nameInput => { | ||
const nameValue = $nameInput.val(); | ||
cy.get('.last[data-cy="data volumes"]') | ||
.find('[data-cy="mount path"]') | ||
.should($mountInput => { | ||
const mountValue = $mountInput.val(); | ||
expect(mountValue).not.equal(`/home/jovyan/${nameValue}`); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
...d-web-apps/jupyter/frontend/src/app/pages/form/form-new/volume/mount/mount.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
<mat-form-field appearance="outline" class="wide"> | ||
<mat-label i18n>Mount path</mat-label> | ||
<input autocomplete="off" matInput [formControl]="volGroup.get('mount')" /> | ||
<input | ||
autocomplete="off" | ||
matInput | ||
[formControl]="volGroup.get('mount')" | ||
data-cy="mount path" | ||
/> | ||
</mat-form-field> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters