Skip to content

Commit 9fd7387

Browse files
committed
Fix coverage
1 parent 8e6a9be commit 9fd7387

10 files changed

Lines changed: 86 additions & 26 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,10 @@ jobs:
3737
- name: Run Build
3838
run: make -C frontend build
3939
- name: Upload coverage reports to Codecov
40-
uses: codecov/codecov-action@v3
40+
uses: codecov/codecov-action@v5
41+
with:
42+
token: ${{ secrets.CODECOV_TOKEN }}
43+
files: ./coverage.xml,./frontend/coverage/lcov.info
44+
flags: backend,frontend
45+
fail_ci_if_error: true
46+
verbose: true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Admin Dashboard for FastAPI / Flask / Django
22

3-
[![codecov](https://codecov.io/gh/vsdudakov/fastadmin/branch/main/graph/badge.svg?token=RNGX5HOW3T)](https://codecov.io/gh/vsdudakov/fastadmin)
3+
[![codecov](https://codecov.io/gh/vsdudakov/fastadmin/branch/main/graph/badge.svg?token=RNGX5HOW3T)](https://app.codecov.io/gh/vsdudakov/fastadmin)
44
[![License](https://img.shields.io/github/license/vsdudakov/fastadmin)](https://github.com/vsdudakov/fastadmin/blob/master/LICENSE)
55
[![PyPi](https://badgen.net/pypi/v/fastadmin)](https://pypi.org/project/fastadmin/)
66
[![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](https://www.python.org/downloads/release/python-3120/)

docs/index.html

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ <h4 class="title">FastAdmin</h4>
196196

197197
<ul class="nav flex-column">
198198

199+
<li class="nav-item">
200+
<a class="nav-link" href="#v0_3_3">v0.3.3</a>
201+
</li>
202+
199203
<li class="nav-item">
200204
<a class="nav-link" href="#v0_3_2">v0.3.2</a>
201205
</li>
@@ -315,7 +319,7 @@ <h1>FastAdmin | Documentation</h1>
315319
<div class="row">
316320
<div class="col-sm-6 col-lg-4">
317321
<ul class="list-unstyled">
318-
<li><strong>Version:</strong> 0.3.2</li>
322+
<li><strong>Version:</strong> 0.3.3</li>
319323
<li>
320324
<strong>Author:</strong>
321325
<a href="mailto:vsdudakov@gmail.com" target="_blank">
@@ -3250,6 +3254,67 @@ <h2>Changelog</h2>
32503254

32513255

32523256

3257+
<section id="v0_3_3">
3258+
<h3>v0.3.3</h3>
3259+
3260+
3261+
3262+
<p class="text-4">
3263+
Fix DetachedInstanceError when session is closed after commit.
3264+
</p>
3265+
3266+
3267+
3268+
3269+
3270+
3271+
3272+
3273+
3274+
3275+
3276+
3277+
3278+
3279+
3280+
<p class="text-4">
3281+
Fix list display widths.
3282+
</p>
3283+
3284+
3285+
3286+
3287+
3288+
3289+
3290+
3291+
3292+
3293+
3294+
3295+
3296+
3297+
3298+
<p class="text-4">
3299+
Fix flask issues.
3300+
</p>
3301+
3302+
3303+
3304+
3305+
3306+
3307+
3308+
3309+
3310+
3311+
3312+
3313+
3314+
3315+
</section>
3316+
3317+
32533318
<section id="v0_3_2">
32543319
<h3>v0.3.2</h3>
32553320

docs/templates/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Admin Dashboard for FastAPI / Flask / Django
22

3-
[![codecov](https://codecov.io/gh/vsdudakov/fastadmin/branch/main/graph/badge.svg?token=RNGX5HOW3T)](https://codecov.io/gh/vsdudakov/fastadmin)
3+
[![codecov](https://codecov.io/gh/vsdudakov/fastadmin/branch/main/graph/badge.svg?token=RNGX5HOW3T)](https://app.codecov.io/gh/vsdudakov/fastadmin)
44
[![License](https://img.shields.io/github/license/vsdudakov/fastadmin)](https://github.com/vsdudakov/fastadmin/blob/master/LICENSE)
55
[![PyPi](https://badgen.net/pypi/v/fastadmin)](https://pypi.org/project/fastadmin/)
66
[![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](https://www.python.org/downloads/release/python-3120/)

frontend/src/components/async-transfer/index.test.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,18 @@ describe("AsyncTransfer", () => {
7575
act(() => {
7676
transferPropsRef.current.onSearch("right", "should-not-apply");
7777
});
78-
let lastQuery = mockUseQuery.mock.calls.at(-1)?.[0] as any;
78+
let lastQuery = mockUseQuery.mock.calls[
79+
mockUseQuery.mock.calls.length - 1
80+
]?.[0] as any;
7981
expect(lastQuery.queryKey[1]).not.toContain("should-not-apply");
8082

8183
act(() => {
8284
transferPropsRef.current.onSearch("left", "john");
8385
});
8486
await waitFor(() => {
85-
lastQuery = mockUseQuery.mock.calls.at(-1)?.[0] as any;
87+
lastQuery = mockUseQuery.mock.calls[
88+
mockUseQuery.mock.calls.length - 1
89+
]?.[0] as any;
8690
expect(lastQuery.queryKey[1]).toContain("search=john");
8791
});
8892
});

frontend/src/components/sign-in-container/index.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test("Renders SignInContainer", () => {
1313
<SignInUserContext.Provider
1414
value={{
1515
signedIn: false,
16-
signedInUser: null,
16+
signedInUser: undefined,
1717
signedInUserRefetch: () => Promise.resolve(undefined as any),
1818
}}
1919
>

frontend/src/components/table-or-cards/cards/index.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ describe("Cards", () => {
3131
]}
3232
rowSelection={{ selectedRowKeys: [], onChange: onRowSelectionChange }}
3333
expandable={{
34-
expandIcon: ({ expanded, onExpand }) => (
35-
<button type="button" onClick={onExpand}>
34+
expandIcon: ({ expanded, onExpand, record }) => (
35+
<button type="button" onClick={(event) => onExpand(record, event)}>
3636
{expanded ? "Collapse" : "Expand"}
3737
</button>
3838
),

frontend/src/helpers/title.test.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ describe("getTitleFromModel", () => {
1515
verbose_name: "User",
1616
verbose_name_plural: "Users",
1717
fields: [],
18-
list_display: [],
19-
list_filter: [],
20-
sortable_by: [],
2118
search_fields: [],
2219
actions: [],
2320
permissions: [],
@@ -32,9 +29,6 @@ describe("getTitleFromModel", () => {
3229
verbose_name: "Event",
3330
verbose_name_plural: "Events",
3431
fields: [],
35-
list_display: [],
36-
list_filter: [],
37-
sortable_by: [],
3832
search_fields: [],
3933
actions: [],
4034
permissions: [],
@@ -47,9 +41,6 @@ describe("getTitleFromModel", () => {
4741
name: "AuditLog",
4842
verbose_name: "Audit log",
4943
fields: [],
50-
list_display: [],
51-
list_filter: [],
52-
sortable_by: [],
5344
search_fields: [],
5445
actions: [],
5546
permissions: [],
@@ -61,9 +52,6 @@ describe("getTitleFromModel", () => {
6152
const model: IModel = {
6253
name: "BaseEvent",
6354
fields: [],
64-
list_display: [],
65-
list_filter: [],
66-
sortable_by: [],
6755
search_fields: [],
6856
actions: [],
6957
permissions: [],
@@ -76,9 +64,6 @@ describe("getTitleFromModel", () => {
7664
const model: IModel = {
7765
name: "event",
7866
fields: [],
79-
list_display: [],
80-
list_filter: [],
81-
sortable_by: [],
8267
search_fields: [],
8368
actions: [],
8469
permissions: [],

frontend/src/helpers/widgets.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe("getWidgetCls", () => {
3232

3333
it("returns DatePicker.RangePicker with placeholder", () => {
3434
const [, props] = getWidgetCls(EFieldWidgetType.RangePicker, _t);
35-
expect(props.placeholder).toEqual(["Start", "End"]);
35+
expect((props as any).placeholder).toEqual(["Start", "End"]);
3636
});
3737

3838
it("returns default Input for unknown type", () => {

frontend/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default defineConfig({
99
setupFiles: ["src/test-setup.ts"],
1010
coverage: {
1111
provider: "v8",
12-
reporter: ["text", "text-summary", "html"],
12+
reporter: ["text", "text-summary", "html", "lcov"],
1313
include: ["src/**/*.{ts,tsx}"],
1414
exclude: [
1515
"src/**/*.test.{ts,tsx}",

0 commit comments

Comments
 (0)