• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pushkar8723 / no-frills-ui / 20405179841

21 Dec 2025 05:17AM UTC coverage: 88.867% (+48.6%) from 40.235%
20405179841

push

github

web-flow
Unit tests for components (#44)

* Added test for disabled button and badge components

* Added tests for first set of components

* Added check around value update process in input components

* Added test for second set of components

* Added test for 3rd set of components

* Handle open on load for drawer and modal components

* Added tests for Drawer and Modal components

* Added test for layer manager

* Added test for Dialog

* Fix minor issues in Diloag and PromtDialog

* Added tests for dialogs

* Added tests for Toast component

* Implementd queue in Notification Manager

* Added test for Notification

* Fixed Notification export

* Fixed skipped tests

* Quick wins to increase coverage

* Production readiness

* Documented Ref forwading

* Added Compatibility Check Workflow

* Fix react 19 compatibility

* Fix tests for react 19

920 of 1235 branches covered (74.49%)

Branch coverage included in aggregate %.

318 of 371 new or added lines in 37 files covered. (85.71%)

421 existing lines in 38 files now uncovered.

6591 of 7217 relevant lines covered (91.33%)

24.32 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.1
/src/components/Dialog/AlertDialog.tsx
1
import React, { createRef } from 'react';
4✔
2
import { Button } from '../Button';
4✔
3
import Dialog, { DialogBody, DialogFooter, DialogHeader } from './Dialog';
4✔
4

144✔
5
type AlertOption = {
144✔
6
    /** Shown as header of the dialog */
144✔
7
    header: string;
144!
8
    /** Rendered in the body. */
144!
9
    body: React.ReactNode;
144✔
10
    /** Accept button text */
144✔
11
    buttonText?: string;
144✔
12
    /** props for the dialog */
144✔
13
    dialogProps?: React.ComponentProps<typeof Dialog>;
4!
UNCOV
14
};
×
UNCOV
15

×
16
let dialogCounter = 0;
×
UNCOV
17

×
18
export default class AlertDialog extends React.Component<AlertOption> {
4✔
19
    private dialog = createRef<Dialog>();
4✔
20

4✔
21
    static defaultProps = {
4✔
22
        buttonText: 'OK',
4✔
23
    };
4✔
24

4✔
25
    public show = () => {
4!
26
        return new Promise((resolve) => {
4✔
27
            const onClose = () => resolve(null);
4✔
28
            this.dialog.current?.open(onClose);
4✔
29
        });
4✔
30
    };
4✔
31

4✔
32
    private close = () => this.dialog.current?.close();
4!
UNCOV
33

×
UNCOV
34
    render() {
×
UNCOV
35
        const titleId = `nfui-alert-dialog-${dialogCounter++}-title`;
×
36
        const descriptionId = `nfui-alert-dialog-${dialogCounter++}-description`;
4✔
37

4✔
38
        return (
4✔
39
            <Dialog
8✔
40
                {...this.props.dialogProps}
8✔
41
                role="alertdialog"
4✔
42
                aria-labelledby={titleId}
4✔
43
                aria-describedby={descriptionId}
4✔
44
                ref={this.dialog}
144✔
45
                closeOnEsc={false}
4✔
46
                closeOnOverlayClick={false}
4✔
47
            >
4✔
48
                {this.props.header && <DialogHeader id={titleId}>{this.props.header}</DialogHeader>}
4✔
49
                <DialogBody id={descriptionId}>{this.props.body}</DialogBody>
4✔
50
                <DialogFooter>
4✔
51
                    <Button onClick={this.close}>{this.props.buttonText}</Button>
4✔
52
                </DialogFooter>
4✔
53
            </Dialog>
4✔
54
        );
4✔
55
    }
4✔
56
}
4✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc