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

add regression tests #10

Merged
merged 2 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
36 changes: 36 additions & 0 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Continuous Integration

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Replace canvas renderer with SVG renderer
run: |
sed -i 's/echarts.init(elem)/echarts.init(elem, null, { renderer: "svg" })/' fava_dashboards/static/dashboard.js

- name: Install fava-dashboards
run: pip3 install .

- name: Start Fava
run: cd example; fava example.beancount &

- name: Install test dependencies
run: cd tests/e2e; npm ci

- name: Run tests
run: cd tests/e2e; npm test -- -t SVG

- name: Run formatter
run: |
make format
git diff --exit-code
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
format:
prettier -w fava_dashboards/static/*.js fava_dashboards/static/*.css
prettier -w fava_dashboards/static/*.js fava_dashboards/static/*.css tests/e2e/*.js
black fava_dashboards/__init__.py scripts/format_js_in_dashboard.py
./scripts/format_js_in_dashboard.py example/dashboards.yaml
find . -name '*.beancount' -exec bean-format -c 59 -o "{}" "{}" \;
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
fava-dashboards allows creating custom dashboards in [Fava](https://github.com/beancount/fava).

Example dashboards with random data:
[![Overview](example/overview.png)](example/overview.png)
[![Assets](example/assets.png)](example/assets.png)
[![Income and Expenses](example/income_expenses.png)](example/income_expenses.png)
[![Travelling](example/travelling.png)](example/travelling.png)
[![Sankey](example/sankey.png)](example/sankey.png)
[![Overview](tests/e2e/__image_snapshots__/dashboard_overview.png)](tests/e2e/__image_snapshots__/dashboard_overview.png)
[![Assets](tests/e2e/__image_snapshots__/dashboard_assets.png)](tests/e2e/__image_snapshots__/dashboard_assets.png)
[![Income and Expenses](tests/e2e/__image_snapshots__/dashboard_income_and_expenses.png)](tests/e2e/__image_snapshots__/dashboard_income_and_expenses.png)
[![Travelling](tests/e2e/__image_snapshots__/dashboard_travelling.png)](tests/e2e/__image_snapshots__/dashboard_travelling.png)
[![Sankey](tests/e2e/__image_snapshots__/dashboard_sankey.png)](tests/e2e/__image_snapshots__/dashboard_sankey.png)

## Installation
```
Expand Down
Binary file removed example/assets.png
Binary file not shown.
Binary file removed example/income_expenses.png
Binary file not shown.
Binary file removed example/overview.png
Binary file not shown.
Binary file removed example/sankey.png
Binary file not shown.
Binary file removed example/travelling.png
Binary file not shown.
1 change: 1 addition & 0 deletions tests/e2e/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading