Skip to content

Commit

Permalink
add test for on value change and readOnly option change
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkithelegendarypokemonster committed Sep 3, 2024
1 parent 661e904 commit 05e919c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/devextreme/js/__internal/ui/m_progress_bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ const ProgressBar = TrackBar.inherit({
case 'statusPosition':
this._toggleStatus(this.option('showStatus'));
break;
case 'readOnly':
this.callBase(args);
this.setAria('readonly', undefined);
break;
case 'onComplete':
this._createCompleteAction();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,35 @@ QUnit.module('aria accessibility', () => {
assert.equal($element.attr('aria-readonly'), undefined, 'aria-readonly is removed');
});

QUnit.test('aria-readonly should not exist after value change', function(assert) {
const $element = $('#progressbar').dxProgressBar({
readOnly: true,
value: 58
});

const instance = $element.dxProgressBar('instance');

instance.option({
value: 59
});

assert.equal($element.attr('aria-readonly'), undefined, 'aria-readonly is removed');
});

QUnit.test('aria-readonly should not exist after readOnly option change', function(assert) {
const $element = $('#progressbar').dxProgressBar({
readOnly: false,
});

const instance = $element.dxProgressBar('instance');

instance.option({
readOnly: true,
});

assert.equal($element.attr('aria-readonly'), undefined, 'aria-readonly is removed');
});

QUnit.test('aria properties after options changed', function(assert) {
const $element = $('#progressbar').dxProgressBar({
min: 32,
Expand Down

0 comments on commit 05e919c

Please sign in to comment.