commit
1a45fd2110
|
@ -38,10 +38,10 @@ context('Create a Table', () => {
|
|||
it('edits a record', () => {
|
||||
cy.get("tbody .ri-more-line").click()
|
||||
cy.get("[data-cy=edit-row]").click()
|
||||
cy.get(".actions input").type("updatedRecord")
|
||||
cy.get(".actions input").type("Updated")
|
||||
cy.contains("Save").click()
|
||||
|
||||
cy.contains('updatedRecord').should('have.text', 'updatedRecord')
|
||||
cy.contains('RoverUpdated').should('have.text', 'RoverUpdated')
|
||||
})
|
||||
|
||||
it('deletes a record', () => {
|
||||
|
@ -49,7 +49,7 @@ context('Create a Table', () => {
|
|||
cy.get("[data-cy=delete-row]").click()
|
||||
cy.get(".modal-actions").contains("Delete").click()
|
||||
|
||||
cy.contains('updatedRecord').should('not.exist')
|
||||
cy.contains('RoverUpdated').should('not.exist')
|
||||
})
|
||||
|
||||
it('deletes a column', () => {
|
||||
|
|
|
@ -93,7 +93,13 @@ export const getBackendUiStore = () => {
|
|||
saveField: ({ originalName, field }) => {
|
||||
store.update(state => {
|
||||
// delete the original if renaming
|
||||
if (originalName) {
|
||||
delete state.draftModel.schema[originalName]
|
||||
state.draftModel._rename = {
|
||||
old: originalName,
|
||||
updated: field.name,
|
||||
}
|
||||
}
|
||||
|
||||
state.draftModel.schema[field.name] = cloneDeep(field)
|
||||
|
||||
|
|
|
@ -45,9 +45,9 @@
|
|||
$: sort = $backendUiStore.sort
|
||||
$: sorted = sort ? fsort(data)[sort.direction](sort.column) : data
|
||||
|
||||
$: headers = Object.keys($backendUiStore.selectedModel.schema).filter(
|
||||
id => !INTERNAL_HEADERS.includes(id)
|
||||
)
|
||||
$: headers = Object.keys($backendUiStore.selectedModel.schema)
|
||||
.sort()
|
||||
.filter(id => !INTERNAL_HEADERS.includes(id))
|
||||
|
||||
$: schema = $backendUiStore.selectedModel.schema
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue