mirror of
https://github.com/go-gitea/gitea
synced 2025-07-04 17:47:19 +00:00
Add a button editing action secret (#34348)
Add a button editing action secret Closes #34190 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
14
web_src/js/features/common-button.test.ts
Normal file
14
web_src/js/features/common-button.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import {assignElementProperty} from './common-button.ts';
|
||||
|
||||
test('assignElementProperty', () => {
|
||||
const elForm = document.createElement('form');
|
||||
assignElementProperty(elForm, 'action', '/test-link');
|
||||
expect(elForm.action).contains('/test-link'); // the DOM always returns absolute URL
|
||||
assignElementProperty(elForm, 'text-content', 'dummy');
|
||||
expect(elForm.textContent).toBe('dummy');
|
||||
|
||||
const elInput = document.createElement('input');
|
||||
expect(elInput.readOnly).toBe(false);
|
||||
assignElementProperty(elInput, 'read-only', 'true');
|
||||
expect(elInput.readOnly).toBe(true);
|
||||
});
|
Reference in New Issue
Block a user