Skip to content

Commit

Permalink
add update test
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthv96 committed Jun 28, 2022
1 parent 457cd02 commit f95c42d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions cypress/e2e/diagramUpdate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ describe('Auto sync tests', () => {
cy.clearLocalStorage();
cy.visit('/');
});

it('should dim diagram when code is edited', () => {
cy.contains('Auto sync').click();
cy.get('#view').should('not.have.class', 'outOfSync');
Expand Down Expand Up @@ -40,4 +41,17 @@ describe('Auto sync tests', () => {
cy.get('#editor').type(`{uparrow}{${cmd}}/`);
cy.get('#view').contains('Car').should('exist');
});

it('supports editing code when code is incorrect', () => {
cy.visit(
'/edit#pako:eNpljjEKwzAMRa8SNOcEnlt6gK5eVFvYJsgOqkwpIXevg9smEE1PnyfxF3DFExgISW-CczQ2D21cYU7a-SGYXRwyvTp9jUhuKlVP-eHy7zA-leQsMEmg_QOM0BLG5FujZVMsaCQmC6ahR5ks2Lw2r84ela4-aREwKpVGwKrl_s7ut3fnkjAIcg_XDzuaUhs'
);
cy.get('#editor').type(`{enter}branch test`);
cy.get('#editor').contains('branch test').should('exist');
cy.get('#errorContainer')
.contains(
'Error: Trying to checkout branch which is not yet created. (Help try using "branch master")'
)
.should('exist');
});
});
2 changes: 1 addition & 1 deletion src/lib/components/view.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</script>

{#if error && $stateStore.error instanceof Error}
<div class="p-2 text-red-600">{$stateStore.error}</div>
<div class="p-2 text-red-600" id="errorContainer">{$stateStore.error}</div>
{/if}

<div id="view" bind:this={view} class="p-2" class:error class:outOfSync>
Expand Down

0 comments on commit f95c42d

Please sign in to comment.