Skip to content

Commit

Permalink
Merge pull request #16 from andreasgerstmayr/tests
Browse files Browse the repository at this point in the history
update tests
  • Loading branch information
andreasgerstmayr authored Sep 10, 2023
2 parents f754291 + c645f7e commit 7eb6635
Show file tree
Hide file tree
Showing 8 changed files with 5,398 additions and 8,750 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,22 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Replace canvas renderer with SVG renderer
- name: Install dependencies
run: |
sed -i 's/echarts.init(elem)/echarts.init(elem, null, { renderer: "svg" })/' frontend/src/extension.ts
sudo pip3 install black
sudo npm install -g prettier
- name: Install test dependencies
run: cd frontend; npm ci

- name: Build
run: cd frontend; npm run build
- name: Build frontend
run: make build

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

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

- name: Run tests
run: cd frontend; npm run test -- -t SVG
- name: Run HTML tests
run: cd frontend; npm run test -- -t HTML

- name: Run formatter
run: |
Expand Down
2 changes: 1 addition & 1 deletion fava_dashboards/FavaDashboards.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion fava_dashboards/templates/FavaDashboards.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% set dashboard_id = request.args.get('dashboard', '0') | int %}
{% set bootstrap = extension.bootstrap(dashboard_id) %}
<script id="favaDashboardsBootstrap" type="application/json">
{{ bootstrap|tojson }}
{{ {"ledger": bootstrap["ledger"], "dashboard": bootstrap["dashboards"][dashboard_id]}|tojson }}
</script>

<div class="headerline">
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ export default {
if (!boostrapJSON) return;

const bootstrap = JSON.parse(boostrapJSON);
const ledger = bootstrap.ledger;
const dashboard = bootstrap.dashboards[bootstrap.dashboardId];

renderDashboard(ledger, dashboard);
renderDashboard(bootstrap.ledger, bootstrap.dashboard);
},
};
3 changes: 1 addition & 2 deletions frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ export interface Dashboard {

export interface Bootstrap {
ledger: Ledger;
dashboards: Dashboard[];
dashboardId: number;
dashboard: Dashboard;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7eb6635

Please sign in to comment.