Merge branch 'master' into daisyUI

* master:
  hide netlify on github
  format netlify
  hide netlify on github
  Fix clock
  Fix clock
  Update mermaid
  Fix test
  Fix test
  Fix test
  Fix test
  remove eslint ignors
  Fix test
  Add powered by netlify
This commit is contained in:
Sidharth Vinod
2021-09-07 00:29:11 +05:30
6 changed files with 53 additions and 1615 deletions
-2
View File
@@ -1,9 +1,7 @@
describe('Check actions', () => { describe('Check actions', () => {
// eslint-disable-next-line mocha/no-hooks-for-single-case
beforeEach(() => { beforeEach(() => {
cy.clearLocalStorage(); cy.clearLocalStorage();
cy.visit('/edit'); cy.visit('/edit');
cy.contains('Actions').click();
}); });
it('should update markdown code', () => { it('should update markdown code', () => {
cy.get('#markdown') cy.get('#markdown')
+4 -1
View File
@@ -1,8 +1,12 @@
describe('Save History', () => { describe('Save History', () => {
beforeEach(() => { beforeEach(() => {
cy.clock();
cy.clearLocalStorage(); cy.clearLocalStorage();
cy.visit('/edit'); cy.visit('/edit');
cy.contains('Actions').click();
cy.contains('History').click();
}); });
it('should save when clicked', () => { it('should save when clicked', () => {
cy.get('#historyList').find('li').should('have.length', 0); cy.get('#historyList').find('li').should('have.length', 0);
cy.get('#historyList').contains('No items in History'); cy.get('#historyList').contains('No items in History');
@@ -43,7 +47,6 @@ describe('Save History', () => {
}); });
it('should auto save history', () => { it('should auto save history', () => {
cy.clock();
cy.get('#editor').type(' C --> HistoryTest'); cy.get('#editor').type(' C --> HistoryTest');
cy.tick(70000); cy.tick(70000);
cy.contains('Timeline').click(); cy.contains('Timeline').click();
+2
View File
@@ -34,6 +34,7 @@ describe('Site Loads', () => {
it('should load diagram from gist', () => { it('should load diagram from gist', () => {
cy.visit(`/edit?gist=https://gist.github.com/sidharthv96/6268a23e673a533dcb198f241fd7012a`); cy.visit(`/edit?gist=https://gist.github.com/sidharthv96/6268a23e673a533dcb198f241fd7012a`);
cy.contains('History').click();
cy.contains('Go shopping!!'); cy.contains('Go shopping!!');
cy.contains('Revisions'); cy.contains('Revisions');
cy.contains('sidharthv96 v8f8f1e2'); cy.contains('sidharthv96 v8f8f1e2');
@@ -45,6 +46,7 @@ describe('Site Loads', () => {
cy.visit( cy.visit(
'/edit?gist=https://gist.github.com/sidharthv96/6268a23e673a533dcb198f241fd7012a/ec9b4ab0e41e4ff6287326cd3cb47affd7851e19' '/edit?gist=https://gist.github.com/sidharthv96/6268a23e673a533dcb198f241fd7012a/ec9b4ab0e41e4ff6287326cd3cb47affd7851e19'
); );
cy.contains('History').click();
cy.contains('Party'); cy.contains('Party');
cy.contains('Revisions'); cy.contains('Revisions');
cy.contains('sidharthv96 v7851e19'); cy.contains('sidharthv96 v7851e19');
+1 -1
View File
@@ -52,7 +52,7 @@
"daisyui": "^1.12.1", "daisyui": "^1.12.1",
"analytics": "^0.7.14", "analytics": "^0.7.14",
"js-base64": "^3.6.1", "js-base64": "^3.6.1",
"mermaid": "^8.11.4", "mermaid": "^8.12.1",
"moment": "^2.29.1", "moment": "^2.29.1",
"monaco-editor": "^0.27.0", "monaco-editor": "^0.27.0",
"random-word-slugs": "^0.0.5" "random-word-slugs": "^0.0.5"
+13 -3
View File
@@ -1,4 +1,6 @@
<script lang="ts"> <script lang="ts">
import { browser } from '$app/env';
import Card from '$lib/components/card/card.svelte'; import Card from '$lib/components/card/card.svelte';
import type { State } from '$lib/types'; import type { State } from '$lib/types';
import { codeStore } from '$lib/util/state'; import { codeStore } from '$lib/util/state';
@@ -131,6 +133,10 @@
let imagemodeselected = 'auto'; let imagemodeselected = 'auto';
let userimagesize = 1080; let userimagesize = 1080;
let isNetlify = false;
if (browser && ['mermaid.live', 'netlify'].some((path) => window.location.host.includes(path))) {
isNetlify = true;
}
codeStore.subscribe((state: State) => { codeStore.subscribe((state: State) => {
const stateCopy = JSON.parse(JSON.stringify(state)); const stateCopy = JSON.parse(JSON.stringify(state));
if (typeof stateCopy.mermaid === 'string') { if (typeof stateCopy.mermaid === 'string') {
@@ -208,8 +214,12 @@
<button class="btn btn-primary btn-md flex-auto" on:click={loadGist}> Load Gist </button> <button class="btn btn-primary btn-md flex-auto" on:click={loadGist}> Load Gist </button>
</label> </label>
</div> </div>
<div class="w-full flex items-center"> {#if isNetlify}
<a class="link" href="https://netlify.com">This site is powered by Netlify</a> <div class="w-full flex items-center justify-center">
</div> <a class="link underline text-gray-500 text-sm" href="https://netlify.com">
This site is powered by Netlify
</a>
</div>
{/if}
</div> </div>
</Card> </Card>
+33 -1608
View File
File diff suppressed because it is too large Load Diff