diff --git a/.snyk b/.snyk new file mode 100644 index 0000000..ae321be --- /dev/null +++ b/.snyk @@ -0,0 +1,22 @@ +# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities. +version: v1.14.1 +ignore: {} +# patches apply the minimum changes required to fix a vulnerability +patch: + SNYK-JS-LODASH-567746: + - lodash: + patched: '2020-05-01T00:42:26.050Z' + - redux-injectors > lodash: + patched: '2020-05-01T00:42:26.050Z' + - styled-components > @babel/traverse > lodash: + patched: '2020-05-01T00:42:26.050Z' + - styled-components > babel-plugin-styled-components > lodash: + patched: '2020-05-01T00:42:26.050Z' + - styled-components > @babel/traverse > @babel/generator > lodash: + patched: '2020-05-01T00:42:26.050Z' + - styled-components > babel-plugin-styled-components > @babel/helper-annotate-as-pure > @babel/types > lodash: + patched: '2020-05-01T00:42:26.050Z' + - styled-components > @babel/traverse > @babel/helper-split-export-declaration > @babel/types > lodash: + patched: '2020-05-01T00:42:26.050Z' + - styled-components > @babel/traverse > @babel/helper-function-name > @babel/template > @babel/types > lodash: + patched: '2020-05-01T00:42:26.050Z' diff --git a/README.md b/README.md index 881d1e9..8b13789 100644 --- a/README.md +++ b/README.md @@ -1,192 +1 @@ -react boilerplate typescript banner -
- -
Start your next react project in seconds
- -
A highly scalable, offline-first foundation with the best DX and a focus on performance and best practices
- -
- -
- - - - - -Dependency Status - - - - - - - -devDependency Status - - - - - - - -Build Status - - - - - - - -Test Coverage - - - - - -Chat with us on Spectrum - - - -
- -
- - - - - -Backers - - - - - - - -Sponsors - - - - - -Supported by Thinkmill - - - -
- -
- -
- -Created by Max Stoiber and maintained with ❀️ by an amazing team of developers. - -
- -This is the **TYPESCRIPT** implementation of the original [**react-boilerplate**](https://github.com/react-boilerplate/react-boilerplate) with extra features and powers of `Typescript` - -> ⚠️ Please refer to the [react-boilerplate](https://github.com/react-boilerplate/react-boilerplate) for the details and the documentation - ---- - -Boilerplate version: [**`4.1`**](https://github.com/react-boilerplate/react-boilerplate-typescript/releases) - -## Overview - -- For the detailed documentation: [**Typescript Docs**](docs/README.md) - -- Example projects built with this boilerplate `(if you are looking for advanced examples)`: - - - [Example 1 (in-production)](https://github.com/International-Slackline-Association/Rankings-UI) `(boilerplate version: 3)` - - - [Example 2 (in-production)](https://github.com/International-Slackline-Association/Web-Tools) `(boilerplate version: 4)` - -- Want to deploy to AWS S3/CloudFront with a single script? -> [**S3 deployment script**](https://gist.github.com/Can-Sahin/d7de7e2ff5c1a39b82ced2d9bd7c60ae) - ---- - -## Getting Started & Features & Documentations and More... - -You can find all the documentation in the original [**react-boilerplate**](https://github.com/react-boilerplate/react-boilerplate) - -For the typescript related documentation: [**Typescript Docs**](docs/README.md) - -## Quick start - -1. Make sure that you have Node.js v10.13.0 and npm v6.4.1 or above installed. -2. Clone this repo using `git clone --depth=1 https://github.com/react-boilerplate/react-boilerplate-typescript.git ` -3. Move to the appropriate directory: `cd `.
-4. Run `npm run setup` in order to install dependencies and clean the git repo.
- _At this point you can run `npm start` to see the example app at `http://localhost:3000`._ -5. Run `npm run clean` to delete the example app. - -Now you're ready to rumble! - ---- - -## Ongoing Work - -In between [releases](https://github.com/react-boilerplate/react-boilerplate-typescript/releases), we work on the `dev` branch and rarely ever update `master`. For that reason, it sometimes look like the repo isn't actively maintained. This isn't the case, React Boilerplate is alive and kicking. - -Please feel free to check out: - -- our [`dev` branch](https://github.com/react-boilerplate/react-boilerplate-typescript/tree/dev) for the latest updates. You are always welcome to use it as the basis for your project. We only merge to `dev` projects which are fully ready. -- our open [issues](https://github.com/react-boilerplate/react-boilerplate/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) and [pull requests](https://github.com/react-boilerplate/react-boilerplate/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc) to see what we are currently working on. Suggestions and contributions are always welcome! - -Keywords: React Boilerplate, Typescript, React.js, Redux, Hot Reloading, ESNext, Babel, react-router, Offline First, ServiceWorker, `styled-components`, redux-saga, FontFaceObserver - -## Contributors - -> Only typescript contributors are displayed here. - - - - - - - - - - -

Can Sahin

πŸ’» πŸ“– πŸ€” πŸ‘€ ⚠️

Gray Strider

πŸ’» πŸ”§ πŸ‘€

Rajat Kanti Nandi

πŸ”§
- - - - - - -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! - -## Supporters - -This project would not be possible without the support of these amazing folks. [**Become a sponsor**](https://opencollective.com/react-boilerplate) to get your company in front of thousands of engaged react developers and help us out! - - - - - - - - - - - - ---- - - - - - - - - - - - - -## License - -This project is licensed under the MIT license, Copyright (c) 2019 Maximilian -Stoiber. For more information see `LICENSE.md`. diff --git a/cypress.json b/cypress.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/cypress.json @@ -0,0 +1 @@ +{} diff --git a/cypress/fixtures/example.json b/cypress/fixtures/example.json new file mode 100644 index 0000000..02e4254 --- /dev/null +++ b/cypress/fixtures/example.json @@ -0,0 +1,5 @@ +{ + "name": "Using fixtures to represent data", + "email": "hello@cypress.io", + "body": "Fixtures are a great way to mock data for responses to routes" +} diff --git a/cypress/integration/examples/actions.spec.js b/cypress/integration/examples/actions.spec.js new file mode 100644 index 0000000..ef430ed --- /dev/null +++ b/cypress/integration/examples/actions.spec.js @@ -0,0 +1,299 @@ +/// + +context('Actions', () => { + beforeEach(() => { + cy.visit('https://example.cypress.io/commands/actions') + }) + + // https://on.cypress.io/interacting-with-elements + + it('.type() - type into a DOM element', () => { + // https://on.cypress.io/type + cy.get('.action-email') + .type('fake@email.com').should('have.value', 'fake@email.com') + + // .type() with special character sequences + .type('{leftarrow}{rightarrow}{uparrow}{downarrow}') + .type('{del}{selectall}{backspace}') + + // .type() with key modifiers + .type('{alt}{option}') //these are equivalent + .type('{ctrl}{control}') //these are equivalent + .type('{meta}{command}{cmd}') //these are equivalent + .type('{shift}') + + // Delay each keypress by 0.1 sec + .type('slow.typing@email.com', { delay: 100 }) + .should('have.value', 'slow.typing@email.com') + + cy.get('.action-disabled') + // Ignore error checking prior to type + // like whether the input is visible or disabled + .type('disabled error checking', { force: true }) + .should('have.value', 'disabled error checking') + }) + + it('.focus() - focus on a DOM element', () => { + // https://on.cypress.io/focus + cy.get('.action-focus').focus() + .should('have.class', 'focus') + .prev().should('have.attr', 'style', 'color: orange;') + }) + + it('.blur() - blur off a DOM element', () => { + // https://on.cypress.io/blur + cy.get('.action-blur').type('About to blur').blur() + .should('have.class', 'error') + .prev().should('have.attr', 'style', 'color: red;') + }) + + it('.clear() - clears an input or textarea element', () => { + // https://on.cypress.io/clear + cy.get('.action-clear').type('Clear this text') + .should('have.value', 'Clear this text') + .clear() + .should('have.value', '') + }) + + it('.submit() - submit a form', () => { + // https://on.cypress.io/submit + cy.get('.action-form') + .find('[type="text"]').type('HALFOFF') + + cy.get('.action-form').submit() + .next().should('contain', 'Your form has been submitted!') + }) + + it('.click() - click on a DOM element', () => { + // https://on.cypress.io/click + cy.get('.action-btn').click() + + // You can click on 9 specific positions of an element: + // ----------------------------------- + // | topLeft top topRight | + // | | + // | | + // | | + // | left center right | + // | | + // | | + // | | + // | bottomLeft bottom bottomRight | + // ----------------------------------- + + // clicking in the center of the element is the default + cy.get('#action-canvas').click() + + cy.get('#action-canvas').click('topLeft') + cy.get('#action-canvas').click('top') + cy.get('#action-canvas').click('topRight') + cy.get('#action-canvas').click('left') + cy.get('#action-canvas').click('right') + cy.get('#action-canvas').click('bottomLeft') + cy.get('#action-canvas').click('bottom') + cy.get('#action-canvas').click('bottomRight') + + // .click() accepts an x and y coordinate + // that controls where the click occurs :) + + cy.get('#action-canvas') + .click(80, 75) // click 80px on x coord and 75px on y coord + .click(170, 75) + .click(80, 165) + .click(100, 185) + .click(125, 190) + .click(150, 185) + .click(170, 165) + + // click multiple elements by passing multiple: true + cy.get('.action-labels>.label').click({ multiple: true }) + + // Ignore error checking prior to clicking + cy.get('.action-opacity>.btn').click({ force: true }) + }) + + it('.dblclick() - double click on a DOM element', () => { + // https://on.cypress.io/dblclick + + // Our app has a listener on 'dblclick' event in our 'scripts.js' + // that hides the div and shows an input on double click + cy.get('.action-div').dblclick().should('not.be.visible') + cy.get('.action-input-hidden').should('be.visible') + }) + + it('.rightclick() - right click on a DOM element', () => { + // https://on.cypress.io/rightclick + + // Our app has a listener on 'contextmenu' event in our 'scripts.js' + // that hides the div and shows an input on right click + cy.get('.rightclick-action-div').rightclick().should('not.be.visible') + cy.get('.rightclick-action-input-hidden').should('be.visible') + }) + + it('.check() - check a checkbox or radio element', () => { + // https://on.cypress.io/check + + // By default, .check() will check all + // matching checkbox or radio elements in succession, one after another + cy.get('.action-checkboxes [type="checkbox"]').not('[disabled]') + .check().should('be.checked') + + cy.get('.action-radios [type="radio"]').not('[disabled]') + .check().should('be.checked') + + // .check() accepts a value argument + cy.get('.action-radios [type="radio"]') + .check('radio1').should('be.checked') + + // .check() accepts an array of values + cy.get('.action-multiple-checkboxes [type="checkbox"]') + .check(['checkbox1', 'checkbox2']).should('be.checked') + + // Ignore error checking prior to checking + cy.get('.action-checkboxes [disabled]') + .check({ force: true }).should('be.checked') + + cy.get('.action-radios [type="radio"]') + .check('radio3', { force: true }).should('be.checked') + }) + + it('.uncheck() - uncheck a checkbox element', () => { + // https://on.cypress.io/uncheck + + // By default, .uncheck() will uncheck all matching + // checkbox elements in succession, one after another + cy.get('.action-check [type="checkbox"]') + .not('[disabled]') + .uncheck().should('not.be.checked') + + // .uncheck() accepts a value argument + cy.get('.action-check [type="checkbox"]') + .check('checkbox1') + .uncheck('checkbox1').should('not.be.checked') + + // .uncheck() accepts an array of values + cy.get('.action-check [type="checkbox"]') + .check(['checkbox1', 'checkbox3']) + .uncheck(['checkbox1', 'checkbox3']).should('not.be.checked') + + // Ignore error checking prior to unchecking + cy.get('.action-check [disabled]') + .uncheck({ force: true }).should('not.be.checked') + }) + + it('.select() - select an option in a