#1891 tests for worker time control function

This commit is contained in:
Carlos Jimenez Ruiz 2019-11-21 11:16:10 +01:00
parent c04640bd62
commit 6a0783d22f
3 changed files with 19 additions and 15 deletions

View File

@ -1,7 +1,6 @@
import './tooltip';
// #1615 migrar karma a jest
xdescribe('Component vnTooltip', () => {
describe('Component vnTooltip', () => {
let $element;
let controller;
let $parent;
@ -21,8 +20,8 @@ xdescribe('Component vnTooltip', () => {
$parent.css({
backgroundColor: 'red',
position: 'absolute',
width: '10px',
height: '10px',
width: '100px',
height: '100px',
top: '0',
left: '0'
});
@ -36,13 +35,13 @@ xdescribe('Component vnTooltip', () => {
describe('show()', () => {
it(`should check that tooltip is visible into the screen`, () => {
expect(element.classList).not.toContain('show');
controller.show($parent[0]);
let rect = element.getBoundingClientRect();
let style = window.getComputedStyle(element);
expect(style.visibility).toEqual('visible');
expect(style.display).not.toEqual('none');
expect(element.classList).toContain('show');
expect(0).toBeLessThanOrEqual(rect.top);
expect(0).toBeLessThanOrEqual(rect.left);
@ -54,14 +53,16 @@ xdescribe('Component vnTooltip', () => {
describe('hide()', () => {
it(`should check that tooltip is not visible`, () => {
controller.show($parent[0]);
controller.hide();
let style = window.getComputedStyle(element);
expect(style.display).toEqual('none');
expect(element.classList).toContain('show');
controller.hide();
expect(element.classList).not.toContain('show');
});
});
describe('relocate()', () => {
// #1892 reparar unitarios front tooltip.js
xdescribe('relocate()', () => {
it(`should reallocate tooltip on top-left`, () => {
controller.show($parent[0]);
let rect = element.getBoundingClientRect();
@ -117,3 +118,6 @@ xdescribe('Component vnTooltip', () => {
});
});
});
['onafterprint', 'onbeforeprint', 'onbeforeunload', 'onhashchange', 'onlanguagechange', 'onmessage', 'onmessageerror', 'onoffline', 'ononline', 'onpagehide', 'onpageshow', 'onpopstate', 'onrejectionhandled', 'onstorage', 'onunhandledrejection', 'onunload', 'onblur', 'onerror', 'onfocus', 'onload', 'onresize', 'onscroll', 'onabort', 'onautocomplete', 'onautocompleteerror', 'oncancel', 'oncanplay', 'oncanplaythrough', 'onchange', 'onclick', 'onclose', 'oncontextmenu', 'oncuechange', 'ondblclick', 'ondrag', 'ondragend', 'ondragenter', 'ondragexit', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'ondurationchange', 'onemptied', 'onended', 'oninput', 'oninvalid', 'onkeydown', 'onkeypress', 'onkeyup', 'onloadeddata', 'onloadedmetadata', 'onloadstart', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onwheel', 'onpause', 'onplay', 'onplaying', 'onprogress', 'onratechange', 'onreset', 'onsecuritypolicyviolation', 'onseeked', 'onseeking', 'onselect', 'onsort', 'onstalled', 'onsubmit', 'onsuspend', 'ontimeupdate', 'ontoggle', 'onvolumechange', 'onwaiting', '_registeredHandlers', '_eventHandlers', '_globalProxy', '_document', '_sessionHistory', '_virtualConsole', '_runScripts', '_top', '_parent', '_frameElement', '_length', '_pretendToBeVisual', '_storageQuota', '_commonForOrigin', '_currentOriginData', '_localStorage', '_sessionStorage', 'length', 'window', 'frameElement', 'frames', 'self', 'parent', 'top', 'document', 'external', 'location', 'history', 'navigator', 'locationbar', 'menubar', 'personalbar', 'scrollbars', 'statusbar', 'toolbar', 'performance', 'screen', 'localStorage', 'sessionStorage', 'addEventListener', 'removeEventListener', 'dispatchEvent', 'setTimeout', 'setInterval', 'clearInterval', 'clearTimeout', 'requestAnimationFrame', 'cancelAnimationFrame', '__stopAllTimers', 'postMessage', 'atob', 'btoa', 'FileReader', 'WebSocket', 'AbortSignal', 'AbortController', 'XMLHttpRequest', 'ArrayBuffer', 'Int8Array', 'Uint8Array', 'Uint8ClampedArray', 'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array', 'Float32Array', 'Float64Array', 'stop', 'close', 'getComputedStyle', 'captureEvents', 'releaseEvents', 'console', 'name', 'devicePixelRatio', 'innerWidth', 'innerHeight', 'outerWidth', 'outerHeight', 'pageXOffset', 'pageYOffset', 'screenX', 'screenY', 'scrollX', 'scrollY', 'screenLeft', 'screenTop', 'alert', 'blur', 'confirm', 'focus', 'moveBy', 'moveTo', 'open', 'print', 'prompt', 'resizeBy', 'resizeTo', 'scroll', 'scrollBy', 'scrollTo', 'process', 'DTRACE_NET_SERVER_CONNECTION', 'DTRACE_NET_STREAM_END', 'DTRACE_HTTP_SERVER_REQUEST', 'DTRACE_HTTP_SERVER_RESPONSE', 'DTRACE_HTTP_CLIENT_REQUEST', 'DTRACE_HTTP_CLIENT_RESPONSE', 'Buffer', 'setImmediate', 'clearImmediate', 'describe', 'xdescribe', 'fdescribe', 'it', 'xit', 'fit', 'beforeEach', 'afterEach', 'beforeAll', 'afterAll', 'pending', 'fail', 'spyOn', 'jsApiReporter', 'jasmine', 'test', 'xtest', 'expect', 'angular', 'module', 'inject', 'browserTrigger', '__core-js_shared__', 'core', 'parseInt', 'parseFloat', 'regeneratorRuntime', '_babelPolyfill', 'magicCrudAngular', 'ngModule']
;

View File

@ -4,7 +4,7 @@
filter="::$ctrl.filter"
data="$ctrl.hours">
</vn-crud-model>
<vn-card class="vn-pa-lg vn-w-md">
<vn-card class="vn-pa-lg vn-w-lg">
<vn-table model="model" auto-load="false">
<vn-thead>
<vn-tr>
@ -31,8 +31,8 @@
</vn-thead>
<vn-tbody>
<vn-tr>
<vn-td ng-repeat="weekday in $ctrl.weekDays" class="hours vn-pa-none" expand center>
<section ng-repeat="hour in weekday.hours" center>
<vn-td ng-repeat="weekday in $ctrl.weekDays" class="hours vn-pa-none" expand>
<section ng-repeat="hour in weekday.hours">
<vn-icon
icon="{{
::hour.direction == 'in' ? 'arrow_forward' : 'arrow_back'
@ -45,7 +45,6 @@
<vn-chip
ng-class="::{'colored': hour.manual}"
removable="::hour.manual"
translate-attr="{title: 'Category'}"
on-remove="$ctrl.showDeleteDialog(hour)">
{{::hour.timed | date: 'HH:mm'}}
</vn-chip>

View File

@ -12,6 +12,7 @@ vn-worker-time-control {
& > section {
display: flex;
align-items: center;
justify-content: center;
padding: .3em 0;
& > vn-icon {