Skip to content

Commit 9cb7464

Browse files
committed
add tests for #769
1 parent 8b272d1 commit 9cb7464

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![npm](https://img.shields.io/badge/npm-DEV-blue.svg)](https://www.npmjs.com/package/jquery.terminal)
99
![bower](https://img.shields.io/badge/bower-DEV-yellow.svg)
1010
[![Build and test](https://github.com/jcubic/jquery.terminal/actions/workflows/build.yaml/badge.svg?branch=devel&event=push)](https://github.com/jcubic/jquery.terminal/actions/workflows/build.yaml)
11-
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=devel&2a3635c935820a1189d8515cc2af0d5a)](https://coveralls.io/github/jcubic/jquery.terminal?branch=devel)
11+
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=devel&3633a1710fb1db2c687546bfda6f1599)](https://coveralls.io/github/jcubic/jquery.terminal?branch=devel)
1212
![NPM Downloads](https://img.shields.io/npm/dm/jquery.terminal.svg?style=flat)
1313
[![jsDelivr Downloads](https://data.jsdelivr.com/v1/package/npm/jquery.terminal/badge?style=rounded&n=1)](https://www.jsdelivr.com/package/npm/jquery.terminal)
1414
[![Paid Support](https://img.shields.io/badge/paid-support-354465.svg)](https://support.jcubic.pl/)

__tests__/terminal.spec.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3007,6 +3007,40 @@ describe('extensions', function() {
30073007
expect(term.find('.terminal-output').html()).toMatchSnapshot();
30083008
expect(term.find('.cmd').attr('style')).toMatchSnapshot();
30093009
});
3010+
it('should invoke all finalize', () => {
3011+
term.echo('top ', {
3012+
finalize(div) {
3013+
div.addClass('top');
3014+
},
3015+
newline: false
3016+
});
3017+
3018+
term.echo('right ', {
3019+
finalize(div) {
3020+
div.addClass('right');
3021+
},
3022+
newline: false
3023+
});
3024+
3025+
term.echo('bottom ', {
3026+
finalize(div) {
3027+
div.addClass('bottom');
3028+
},
3029+
newline: false
3030+
});
3031+
3032+
term.echo('left', {
3033+
finalize(div) {
3034+
div.addClass('left');
3035+
}
3036+
});
3037+
3038+
term.refresh();
3039+
expect(term.get_output()).toEqual('top right bottom left');
3040+
['top', 'right', 'bottom', 'left'].forEach((cls) => {
3041+
expect(term.find('.terminal-output .' + cls).length).toBe(1);
3042+
});
3043+
});
30103044
});
30113045
describe('autocomplete_menu', function() {
30123046
function completion(term) {

0 commit comments

Comments
 (0)