mirror of
https://github.com/go-gitea/gitea
synced 2025-07-13 05:57:20 +00:00
Refactor dropzone (#31482)
Refactor the legacy code and remove some jQuery calls.
This commit is contained in:
@ -1,5 +1,16 @@
|
||||
import {createElementFromHTML} from './dom.js';
|
||||
import {createElementFromAttrs, createElementFromHTML} from './dom.js';
|
||||
|
||||
test('createElementFromHTML', () => {
|
||||
expect(createElementFromHTML('<a>foo<span>bar</span></a>').outerHTML).toEqual('<a>foo<span>bar</span></a>');
|
||||
});
|
||||
|
||||
test('createElementFromAttrs', () => {
|
||||
const el = createElementFromAttrs('button', {
|
||||
id: 'the-id',
|
||||
class: 'cls-1 cls-2',
|
||||
'data-foo': 'the-data',
|
||||
disabled: true,
|
||||
required: null,
|
||||
});
|
||||
expect(el.outerHTML).toEqual('<button id="the-id" class="cls-1 cls-2" data-foo="the-data" disabled=""></button>');
|
||||
});
|
||||
|
Reference in New Issue
Block a user