mirror of
https://github.com/go-gitea/gitea.git
synced 2025-05-18 14:32:14 +02:00
Add a button editing action secret Closes #34190 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 lines
582 B
TypeScript
15 lines
582 B
TypeScript
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);
|
|
});
|