Go to file
Matias Arriola b804403c42 Merged in feature/tests-and-docs (pull request #9)
Improve testing flow and docs

* update snapshots

* update snapshots

* update snapshots

* Add docker run instructions

* Hide image snapshot execution behind an env flag

* Simplify package.json scripts and improve docs

* Merge 'origin/develop' into feature/tests-and-docs

* Update snapshots

* Add wait to container test

* Update snapshot


Approved-by: Paulo Veiga
2021-12-17 02:13:54 +00:00
lang refactor: support lerna, include @wisemapping/login into webapp 2020-12-05 02:47:02 -05:00
libraries Remove mootools as dependency. 2021-12-14 17:06:09 +00:00
packages Merged in feature/tests-and-docs (pull request #9) 2021-12-17 02:13:54 +00:00
.dockerignore Merged in feature/tests-and-docs (pull request #9) 2021-12-17 02:13:54 +00:00
.eslintcache Revert "Move lint" 2021-10-04 16:22:33 -07:00
.gitignore Ignore build directory 2020-12-05 14:22:44 -08:00
.nvmrc Increase coverage migrating tests. 2021-12-14 15:08:54 +00:00
.prettierignore adding basic config for prettier 2021-02-22 22:17:44 -08:00
.prettierrc.json Merged in feat/prettier (pull request #3) 2021-02-23 07:02:15 +00:00
CONTRIBUTING.md Merged in feature/tests-and-docs (pull request #9) 2021-12-17 02:13:54 +00:00
README.md Merged in feature/tests-and-docs (pull request #9) 2021-12-17 02:13:54 +00:00
bitbucket-pipelines.yml Merged in feature/tests-and-docs (pull request #9) 2021-12-17 02:13:54 +00:00
docker-compose.snapshots.update.yml Merged in feature/tests-and-docs (pull request #9) 2021-12-17 02:13:54 +00:00
docker-compose.snapshots.yml Merged in feature/tests-and-docs (pull request #9) 2021-12-17 02:13:54 +00:00
lerna.json refactor: support lerna, include @wisemapping/login into webapp 2020-12-05 02:47:02 -05:00
package.json Merged in feature/tests-and-docs (pull request #9) 2021-12-17 02:13:54 +00:00
webpack.common.js Merged in web2d-coreJS-solutions (pull request #5) 2021-12-02 00:41:56 +00:00
yarn.lock Merged in feature/tests-and-docs (pull request #9) 2021-12-17 02:13:54 +00:00

README.md

wisemapping-frontend

This is a WIP migration from legacy wisemapping into a modern web development project with multiple improvements.

This monorepo uses lerna and contains all the packages that compose the wisemapping frontend.

Getting started

Make sure you have NodeJs installed (version compatible with package.json engine), and yarn installed (npm i -g yarn).

nvm use
yarn install
yarn bootstrap

Please refer to each package's Readme.md for anything specific to the package.

If you want to contribute, please check out CONTRIBUTING.md.

Scripts

Each package might provide the following scripts.
You can run these for all packages by running it from the root folder. Alternatively you can run it for a specific package from inside the package folder you want to.

build

Production build

yarn build

lint

run eslint

yarn lint

playground

start a devServer with some browsable examples

yarn playground

test

run all the tests

yarn test

run only integration tests

yarn test:integration

run only unit tests

yarn test:unit

Image Snapshot Testing

We use cypress-image-snapshot for snapshot testing. This is a relatively cheap way of identifying behavior changes based on page screenshots. See visual testing docs for more information.

When a test that contains a matchImageSnapshot call is run, it compares the snapshot to the corresponding one in the snapshots directory. If Any change is detected, the test will fail, and the diff can be found in the cypress/snapshots/*/__diff_output__ folder. If the change is intentional, we should "accept" those changes by updating the snapshot and include it in the commit.

There is a caveat where colors, fonts or ui may differ depending on the host machine running the tests.

A workaround for this is to run the tests using docker. Make sure you have docker and docker-compose installed.

Run snapshot tests: docker-compose -f docker-compose.snapshots.yml up
If anything changed, and the change was intentional, update the snapshots and then commit the new images to source control.
Update snapshots: docker-compose -f docker-compose.snapshots.update.yml up