Skip to content

Commit

Permalink
Merge pull request mermaid-js#335 from mermaid-js/netlify
Browse files Browse the repository at this point in the history
Add powered by netlify
  • Loading branch information
sidharthv96 authored Sep 5, 2021
2 parents c3ed8ae + d40d476 commit bcd6bb5
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
2 changes: 0 additions & 2 deletions cypress/integration/actions.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
describe('Check actions', () => {
// eslint-disable-next-line mocha/no-hooks-for-single-case
beforeEach(() => {
cy.clearLocalStorage();
cy.visit('/edit');
cy.contains('Actions').click();
});
it('should update markdown code', () => {
cy.get('#markdown')
Expand Down
5 changes: 4 additions & 1 deletion cypress/integration/history.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
describe('Save History', () => {
beforeEach(() => {
cy.clock();
cy.clearLocalStorage();
cy.visit('/edit');
cy.contains('Actions').click();
cy.contains('History').click();
});

it('should save when clicked', () => {
cy.get('#historyList').find('li').should('have.length', 0);
cy.get('#historyList').contains('No items in History');
Expand Down Expand Up @@ -43,7 +47,6 @@ describe('Save History', () => {
});

it('should auto save history', () => {
cy.clock();
cy.get('#editor').type(' C --> HistoryTest');
cy.tick(70000);
cy.contains('Timeline').click();
Expand Down
2 changes: 2 additions & 0 deletions cypress/integration/loadSite.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('Site Loads', () => {

it('should load diagram from gist', () => {
cy.visit(`/edit?gist=https://gist.github.com/sidharthv96/6268a23e673a533dcb198f241fd7012a`);
cy.contains('History').click();
cy.contains('Go shopping!!');
cy.contains('Revisions');
cy.contains('sidharthv96 v8f8f1e2');
Expand All @@ -45,6 +46,7 @@ describe('Site Loads', () => {
cy.visit(
'/edit?gist=https://gist.github.com/sidharthv96/6268a23e673a533dcb198f241fd7012a/ec9b4ab0e41e4ff6287326cd3cb47affd7851e19'
);
cy.contains('History').click();
cy.contains('Party');
cy.contains('Revisions');
cy.contains('sidharthv96 v7851e19');
Expand Down
2 changes: 1 addition & 1 deletion cypress/snapshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
"1": "{\"code\":\"graph TD\\n A[Party] -->|Get money| B(Go shopping!!)\\n \",\"mermaid\":\"{\\n \\\"theme\\\": \\\"forest\\\",\\n \\\"test\\\": \\\"hello world\\\"\\n}\",\"updateEditor\":false,\"autoSync\":true,\"updateDiagram\":true,\"loader\":{\"type\":\"files\",\"config\":{\"codeURL\":\"https://gist.githubusercontent.com/sidharthv96/6268a23e673a533dcb198f241fd7012a/raw/4eb03887e6a41397e80bdcdbf94017c498f8f1e2/code.mmd\",\"configURL\":\"https://gist.githubusercontent.com/sidharthv96/6268a23e673a533dcb198f241fd7012a/raw/4eb03887e6a41397e80bdcdbf94017c498f8f1e2/config.json\"}}}"
}
},
"__version": "8.3.0",
"__version": "8.3.1",
"Auto sync tests": {
"should dim diagram when code is edited": {
"1": "{\"code\":\"graph TD\\n A[Christmas] -->|Get money| B(Go shopping)\\n B --> C{Let me think}\\n C -->|One| D[Laptop]\\n C -->|Two| E[iPhone]\\n C -->|Three| F[fa:fa-car Car]\\n C --> Test\",\"mermaid\":\"{\\n \\\"theme\\\": \\\"default\\\"\\n}\",\"updateEditor\":false,\"autoSync\":false,\"updateDiagram\":false}"
Expand Down
5 changes: 4 additions & 1 deletion src/lib/components/actions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
});
</script>

<Card title="Actions" isOpen={false}>
<Card title="Actions" isOpen={true}>
<div class="flex flex-wrap gap-2 m-2">
{#if isClipboardAvailable()}
<button class="action-btn w-full" on:click={onCopyClipboard}
Expand Down Expand Up @@ -194,5 +194,8 @@
<button class="btn text-white flex-auto" on:click={loadGist}> Load Gist </button>
</label>
</div>
<div class="w-full flex items-center">
<a class="link" href="https://netlify.com">This site is powered by Netlify</a>
</div>
</div>
</Card>
4 changes: 2 additions & 2 deletions src/lib/components/card/tabs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
{#each tabs as tab}
<li class="mr-2 last:mr-0 w-28 h-6 flex-auto text-center">
<div
class="text cursor-pointer font-semibold min-w-16 w-auto px-2 py-1 -mb-4 rounded-t block leading-normal {activeTabID ===
class="text cursor-pointer font-semibold min-w-16 w-auto px-2 py-1 -mb-4 rounded-t flex justify-center items-center leading-normal {activeTabID ===
tab.id
? 'text-indigo-500 bg-white border-white'
: 'text-white bg-indigo-500 border-indigo-500 hover:bg-indigo-600'}"
on:click|stopPropagation={() => toggleTabs(tab)}>
<i class={tab.icon} />
<i class="{tab.icon} mr-1" />
{tab.title}
</div>
</li>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/history/history.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
}
});
let isOpen = true;
let isOpen = false;
</script>

<Card on:select={tabSelectHandler} bind:isOpen {tabs} title="History">
Expand Down

0 comments on commit bcd6bb5

Please sign in to comment.