Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looking for a new feature branch for exporting! #3

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
},

"postCreateCommand": "yarn install",
"postStartCommand": "yarn start"
"postStartCommand": "yarn start",
"postAttachCommand": "npx cypress run"

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
Expand Down
216 changes: 176 additions & 40 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,49 +1,185 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# Created by https://www.toptal.com/developers/gitignore/api/node,cypressio,angular
# Edit at https://www.toptal.com/developers/gitignore?templates=node,cypressio,angular

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log
### Angular ###
## Angular ##
# compiled output
dist/
tmp/
app/**/*.js
app/**/*.js.map

# dependencies
node_modules/
bower_components/

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio CodeBlock
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular/cache

# misc
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
connect.lock/
coverage/
libpeerconnection.log/
npm-debug.log
testem.log
/typings
typings/
.angular/

# e2e
e2e/*.js
e2e/*.map

# System Files
.DS_Store/

### CypressIO ###
# gitignore template for the CypressIO, browser test framework
# website: https://www.cypress.io/

cypress/results/*
cypress/reports/*
cypress/screenshots/*
cypress/videos/*
cypress/downloads/*

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

### Node Patch ###
# Serverless Webpack directories
.webpack/

# Optional stylelint cache

# System files
.DS_Store
Thumbs.db
# SvelteKit build / generate output
.svelte-kit

src/env/env.prod.ts
.firebaserc
firebase-debug.log
.firebase
environment.test.ts
# End of https://www.toptal.com/developers/gitignore/api/node,cypressio,angular
1 change: 1 addition & 0 deletions cypress/e2e/code-testing.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ describe('EditorJS Code Testing', function() {
cy.get('.ce-header').click().get('.ce-toolbar__plus').click().get('[data-item-name="code"]').click();
cy.get('.editor').type("'Hello World!'{shift}{enter}");
cy.get('#checkpoint').should('contain', 'Saving');
cy.wait(20000);
cy.get('.output').should('contain', "'Hello World!'");
});

Expand Down
18 changes: 18 additions & 0 deletions cypress/e2e/reload-testing.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
describe('EditorJS Reload', function() {
// @ts-ignore
beforeEach(() => cy.clearIndexedDB());
it('should input content to EditorJS and retrieve the same content after reload', function() {
cy.visit('http://localhost:4200/?t=lcbkvhcafy&p=xvgctvcyva');
cy.wait(10000);
cy.get('.ce-header').type("{enter}0{enter}");
cy.get('.ce-paragraph').eq(1).type("1{enter}");
cy.get('.ce-paragraph').eq(2).type("2{enter}");
cy.get('#checkpoint').should('contain', 'Saving');
cy.wait(5000);
cy.reload();
cy.get('.ce-paragraph').eq(0).should("contain.text", "0");
cy.get('.ce-paragraph').eq(1).should("contain.text", "1");
cy.get('.ce-paragraph').eq(2).should("contain.text", "2");
});

});
47 changes: 12 additions & 35 deletions cypress/e2e/simple-editing.cy.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// Due to instabilities, this seems to occasionally fail.

describe('EditorJS interaction', function() {
// @ts-ignore
beforeEach(() => cy.clearIndexedDB());
it('input content to EditorJS and retrieve the same content after reload', function() {
it('should input content to EditorJS and retrieve the same content after reload', function() {
cy.visit('http://localhost:4200');
cy.get('.ce-header').click().type("Title"+"{enter}");
cy.get('.ce-paragraph').type("1{enter}");
cy.get('.ce-paragraph').eq(1).type("2{enter}");
cy.get('.ce-paragraph').eq(2).type("3{enter}");
cy.get('.ce-paragraph').eq(3).type("4{enter}");
cy.get('.ce-paragraph').eq(4).type("5");
cy.get('.ce-header').click().type("Title{enter}");
cy.get('.ce-paragraph').type("1{enter}2{enter}3{enter}4{enter}5");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, it makes sense and is more concise, but it requires an assertion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which assertion do you suggest?

cy.get('#checkpoint').should('contain', 'Saving');
cy.wait(500);
cy.reload();
Expand All @@ -18,7 +16,7 @@ describe('EditorJS interaction', function() {
});
});

it('update content and retrieve the same content after reload', function() {
it('should update content and retrieve the same content after reload', function() {
cy.visit('http://localhost:4200');
cy.get('.ce-header').click().type("Title"+"{enter}");
cy.get('.ce-paragraph').type("1{enter}");
Expand Down Expand Up @@ -46,7 +44,7 @@ describe('EditorJS interaction', function() {
cy.get('.ce-paragraph').should('contain',"5 F");
});

it('delete content with backspace and retrieve the same content after reload', function() {
it('should delete content with backspace and retrieve the same content after reload', function() {
cy.visit('http://localhost:4200');
cy.get('.ce-header').click().type("Title"+"{enter}");
cy.get('.ce-paragraph').type("1{enter}");
Expand All @@ -57,7 +55,7 @@ describe('EditorJS interaction', function() {
cy.get('#checkpoint').should('contain', 'Saving');
cy.wait(500);
cy.reload();
cy.get('.ce-header').click().type("Title A");
cy.get('.ce-header').click().type("Title");
cy.get('.ce-paragraph').eq(0).type("1 B");
cy.get('.ce-paragraph').eq(1).type("2 C");
cy.get('.ce-paragraph').eq(2).type("3 D");
Expand All @@ -72,13 +70,13 @@ describe('EditorJS interaction', function() {
cy.wait(500);
cy.reload();
cy.wait(500);
cy.get('.ce-header').should('contain', "Title A");
cy.get('.ce-header').should('contain', "Title");
cy.get('.ce-paragraph').eq(0).should('contain', "1 B");
cy.get('.ce-paragraph').eq(1).should('contain',"3 D");
cy.get('.ce-paragraph').eq(2).should('contain',"5 F");
});

it('delete content with button and retrieve the same content after reload', function() {
it('should delete content with button and retrieve the same content after reload', function() {
cy.visit('http://localhost:4200');
cy.get('.ce-header').click().type("Title"+"{enter}");
cy.get('.ce-paragraph').type("1{enter}");
Expand Down Expand Up @@ -113,7 +111,7 @@ describe('EditorJS interaction', function() {
cy.get('.ce-paragraph').eq(3).should('contain',"6 G");
});

it('delete content with multiple selection and retrieve the same content after reload', function() {
it('should delete content with multiple selection and retrieve the same content after reload', function() {
cy.visit('http://localhost:4200');
cy.get('.ce-header').click().type("Title"+"{enter}");
cy.get('.ce-paragraph').type("1{enter}");
Expand All @@ -134,7 +132,7 @@ describe('EditorJS interaction', function() {
cy.get('.ce-paragraph').eq(4).should('contain',"6");
});

it('move up with button and retrieve the same content after reload', function() {
it('should move up with button and retrieve the same content after reload', function() {
cy.visit('http://localhost:4200');
cy.get('.ce-header').click().type("Title"+"{enter}");
cy.get('.ce-paragraph').type("1{enter}");
Expand Down Expand Up @@ -164,25 +162,4 @@ describe('EditorJS interaction', function() {
cy.get('.ce-paragraph').eq(4).should('contain',"5");
cy.get('.ce-paragraph').eq(5).should('contain',"6");
});

it.only('input content to EditorJS and retrieve the same content after reload', function() {
cy.visit('http://localhost:4200/?ps=jddkzpqlyv&t=pqnszpmzlr');
cy.wait(10000);
for (let i = 0; i < 3; i++) {
cy.get('.ce-paragraph').eq(0).type("2");
cy.get('.ce-paragraph').eq(1).type("3");
cy.get('.ce-paragraph').eq(2).type("4");
cy.get('.ce-paragraph').eq(3).type("5");
cy.get('.ce-paragraph').eq(4).type("6");
cy.get('#checkpoint').should('contain', 'Saving');
cy.wait(15000);
cy.reload();
cy.get('.ce-paragraph').eq(0).should("contain.text", "22");
cy.get('.ce-paragraph').eq(1).should("contain.text", "33");
cy.get('.ce-paragraph').eq(2).should("contain.text", "44");
cy.get('.ce-paragraph').eq(3).should("contain.text", "55");
cy.get('.ce-paragraph').eq(4).should("contain.text", "66");
}
});

});