Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XWIKI-18711: Properties of type number cannot be switched to edit mode
- Loading branch information
1 parent
aa24112
commit 8cef3ce
Showing
2 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
...ata/xwiki-platform-livedata-webjar/src/main/tests/unit/displayers/DisplayerNumber.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
|
||
import DisplayerNumber from "../../../displayers/DisplayerNumber"; | ||
import {initWrapper} from "./displayerTestsHelper"; | ||
|
||
describe('DisplayerNumber.vue', () => { | ||
it('Renders an entry in view mode', () => { | ||
const wrapper = initWrapper(DisplayerNumber, { | ||
props: { | ||
propertyId: 'quantity', | ||
entry: { | ||
quantity: 42 | ||
} | ||
} | ||
}) | ||
expect(wrapper.text()).toMatch('42') | ||
}) | ||
|
||
it('Renders an entry in edit mode', async () => { | ||
const wrapper = initWrapper(DisplayerNumber, { | ||
props: { | ||
propertyId: 'quantity', | ||
entry: { | ||
quantity: 42 | ||
} | ||
} | ||
}) | ||
|
||
const viewerDiv = wrapper.find('div[tabindex="0"]'); | ||
await viewerDiv.trigger('dblclick'); | ||
|
||
expect(wrapper.find('input').element.value).toBe('42') | ||
expect(wrapper.find('input').element).toHaveFocus() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters