-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OHRM5X-1627: OXD 1.0.6 Release (#484)
* OHRM5X-778: Add localization date format support to date input (#287) * OHRM5X-1355: Add OXD-Color input field (#292) * OHRM5X-1385: Add thumbs up/down icons (#341) * OHRM5X-1456: Change variables for OXD theming (#363) * OHRM5X-1352: Add social media svg icons (#371) * OHRM5X-377: Fix general defects (#378) * OHRM5X-390: OXD Grid side margin fix to allow grid content alignment in card * OHRM5X-379: OXD sheet/table filter padding fixes * OHRM5X-378: OXD Grid remove verticle paddings * OHRM5X-629: OXD Dialog style issue fixes * OHRM5X-1481: Fix color input TouchEvent undefined issue in Firefox (#387) * OHRM5X-629: OXD Dialog gutters prop added * OHRM5X-1481: OXD Color fix Firefox issue with TouchEvent undefined * OHRM5X-377: OXD Form prevents showing errors while loading * OHRM5X-1501: Upload jest coverage artifacts (#402) * OHRM5X-1500: Support 8 columns grid (#408) * OHRM5X-1500: OXD Grid add 8 column support * OHRM5X-1402: OXD multiselect autocomplete selected items are removed on backspace fix * OHRM5X-1491: Improve useResponsive composable (#434) * OHRM5X-1507: Add SVG client logo & banner support to layout (#449) * OHRM5X-1507: Add SVG support for layout * OHRM5X-1507: Append version to title * OHRM5X-1507: Change storybook favicon * OHRM5X-1586: Prevent OXD Form validation of disabled fields (#458) * OHRM5X-1588: Validate date input value with display date format (#463) * OHRM5X-1628: Bump version to 1.0.6 (#483) Co-authored-by: devishke-orange <[email protected]> Co-authored-by: Rajitha Kumara <[email protected]>
- Loading branch information
1 parent
3fac47b
commit 5bcfab9
Showing
95 changed files
with
3,063 additions
and
308 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Lint | |
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
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
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 |
---|---|---|
|
@@ -3,4 +3,5 @@ module.exports = { | |
transform: { | ||
'^.+\\.vue$': 'vue-jest', | ||
}, | ||
coverageReporters: ['html'], | ||
}; |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
135 changes: 135 additions & 0 deletions
135
components/src/composables/__tests__/useResponsive.spec.ts
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,135 @@ | ||
/* | ||
* This file is part of OrangeHRM Inc | ||
* | ||
* Copyright (C) 2020 onwards OrangeHRM Inc | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program 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 General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses | ||
*/ | ||
|
||
import {nextTick, toRefs} from 'vue'; | ||
import {shallowMount} from '@vue/test-utils'; | ||
import useResponsive, {DEVICE_XL, DEVICE_XS} from '../useResponsive'; | ||
|
||
describe('components/src/composables/useResponsive', () => { | ||
const addEventListener = jest.spyOn(window, 'addEventListener'); | ||
const removeEventListener = jest.spyOn(window, 'removeEventListener'); | ||
|
||
beforeEach(() => { | ||
Object.defineProperty(window, 'innerHeight', { | ||
writable: true, | ||
configurable: true, | ||
value: 1080, | ||
}); | ||
Object.defineProperty(window, 'innerWidth', { | ||
writable: true, | ||
configurable: true, | ||
value: 1920, | ||
}); | ||
}); | ||
|
||
it('sets event handler for resize event', async () => { | ||
shallowMount({ | ||
setup() { | ||
useResponsive(); | ||
}, | ||
template: '<div></div>', | ||
}); | ||
await nextTick(); | ||
expect(addEventListener).toHaveBeenCalled(); | ||
}); | ||
|
||
it('remove event handler for resize event', async () => { | ||
shallowMount({ | ||
setup() { | ||
useResponsive(); | ||
}, | ||
template: '<div></div>', | ||
}).unmount(); | ||
await nextTick(); | ||
expect(removeEventListener).toHaveBeenCalled(); | ||
}); | ||
|
||
it('returns correct window height & width on mount', async () => { | ||
const wrapper = shallowMount({ | ||
setup() { | ||
const responsiveState = useResponsive(); | ||
return { | ||
...toRefs(responsiveState), | ||
}; | ||
}, | ||
template: '<div></div>', | ||
}); | ||
await nextTick(); | ||
|
||
expect(wrapper.vm.windowWidth).toStrictEqual(1920); | ||
expect(wrapper.vm.windowHeight).toStrictEqual(1080); | ||
}); | ||
|
||
it('update window height & width on resize', async () => { | ||
const wrapper = shallowMount({ | ||
setup() { | ||
const responsiveState = useResponsive(); | ||
return { | ||
...toRefs(responsiveState), | ||
}; | ||
}, | ||
template: '<div></div>', | ||
}); | ||
|
||
Object.defineProperty(window, 'innerHeight', { | ||
writable: true, | ||
configurable: true, | ||
value: 720, | ||
}); | ||
Object.defineProperty(window, 'innerWidth', { | ||
writable: true, | ||
configurable: true, | ||
value: 1280, | ||
}); | ||
window.dispatchEvent(new Event('resize')); | ||
await nextTick(); | ||
|
||
expect(wrapper.vm.windowWidth).toStrictEqual(1280); | ||
expect(wrapper.vm.windowHeight).toStrictEqual(720); | ||
}); | ||
|
||
it('update screen type on resize', async () => { | ||
const wrapper = shallowMount({ | ||
setup() { | ||
const responsiveState = useResponsive(); | ||
return { | ||
...toRefs(responsiveState), | ||
}; | ||
}, | ||
template: '<div></div>', | ||
}); | ||
await nextTick(); | ||
expect(wrapper.vm.screenType).toStrictEqual(DEVICE_XL); | ||
|
||
Object.defineProperty(window, 'innerHeight', { | ||
writable: true, | ||
configurable: true, | ||
value: 320, | ||
}); | ||
Object.defineProperty(window, 'innerWidth', { | ||
writable: true, | ||
configurable: true, | ||
value: 568, | ||
}); | ||
window.dispatchEvent(new Event('resize')); | ||
await nextTick(); | ||
|
||
expect(wrapper.vm.screenType).toStrictEqual(DEVICE_XS); | ||
}); | ||
}); |
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
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
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
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
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
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
Oops, something went wrong.