Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prevent changing order of readOnly arrays (#563)
- Loading branch information
1 parent
5bfde9d
commit 16b7edb
Showing
6 changed files
with
127 additions
and
43 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,76 @@ | ||
describe('Fields', () => { | ||
before(() => { | ||
cy.apiLogin(); | ||
}); | ||
|
||
describe('Array', () => { | ||
beforeEach(() => { | ||
cy.visit('/admin/collections/all-fields/create'); | ||
}); | ||
|
||
it('can add and remove rows', () => { | ||
cy.contains('Add Array').click(); | ||
|
||
cy.contains('Array Text 1') | ||
.should('be.visible'); | ||
|
||
cy.get('.action-panel__add-row').first().click(); | ||
|
||
cy.get('.field-type.array') | ||
.filter(':contains("Editable Array")') | ||
.should('contain', '02'); | ||
|
||
cy.get('.action-panel__remove-row').first().click(); | ||
|
||
cy.get('.field-type.array') | ||
.filter(':contains("Editable Array")') | ||
.should('not.contain', '02') | ||
.should('contain', '01'); | ||
}); | ||
|
||
it('can be readOnly', () => { | ||
cy.get('.field-type.array') | ||
.filter(':contains("readOnly Array")') | ||
.should('not.contain', 'Add Row'); | ||
|
||
cy.get('.field-type.array') | ||
.filter(':contains("readOnly Array")') | ||
.children('.action-panel__add-row') | ||
.should('not.exist'); | ||
|
||
cy.get('.field-type.array') | ||
.filter(':contains("readOnly Array")') | ||
.children('.position-panel__move-backward') | ||
.should('not.exist'); | ||
|
||
cy.get('.field-type.array') | ||
.filter(':contains("readOnly Array")') | ||
.children('.position-panel__move-forward') | ||
.should('not.exist'); | ||
}); | ||
}); | ||
|
||
describe('Admin', () => { | ||
describe('Conditions', () => { | ||
beforeEach(() => { | ||
cy.visit('/admin/collections/conditions/create'); | ||
}); | ||
|
||
it('can see conditional fields', () => { | ||
cy.get('#simpleCondition') | ||
.should('not.exist'); | ||
|
||
cy.get('#customComponent') | ||
.should('not.exist'); | ||
|
||
cy.contains('Enable Test').click(); | ||
|
||
cy.get('#simpleCondition') | ||
.should('be.visible'); | ||
|
||
cy.get('#customComponent') | ||
.should('be.visible'); | ||
}); | ||
}); | ||
}); | ||
}); |
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
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
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
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