PGP key list input fix (#13038)

* fixes issue with pgp list file input count not matching key shares number

* adds changelog entry
This commit is contained in:
Jordan Reimer
2021-11-04 14:25:15 -06:00
committed by GitHub
parent 063d19aa9a
commit d6f90e2814
3 changed files with 26 additions and 4 deletions

View File

@@ -128,4 +128,26 @@ module('Integration | Component | pgp list', function(hooks) {
'lengthening the list with an array with one base64 converted files'
);
});
test('it should render correct amount of file components on listLength change', async function(assert) {
assert.expect(4);
this.set('listLength', null);
await render(hbs`
<PgpList
@listLength={{this.listLength}}
/>
`);
[1, 5, 3, 0].forEach(count => {
this.set('listLength', count);
if (count) {
assert
.dom('[data-test-pgp-file]')
.exists({ count }, `Correct number of file inputs render when listLength is updated to ${count}`);
} else {
assert.dom('[data-test-empty-text]').exists('Placeholder renders when list length is zero');
}
});
});
});