Unverified Commit 1f737970 authored by Vitaliy Makogon's avatar Vitaliy Makogon Committed by GitHub
Browse files

Merge branch 'development' into fix-datepicker-ivy

parents 2d84f87e 669d7e1d
Showing with 458 additions and 133 deletions
+458 -133
......@@ -35,8 +35,9 @@ Best way to quickly integrate <a href="https://getbootstrap.com/">Bootstrap 3</a
3. [Installation instructions](#installation-instructions)
4. [Usage & Demo](#usage--demo)
5. [API](#api)
6. [Troubleshooting](#troubleshooting)
7. [Contributing](#contribution)
6. [Compatibility](#compatibility)
7. [Troubleshooting](#troubleshooting)
8. [Contributing](#contribution)
## Getting Started
......@@ -163,6 +164,20 @@ For local development run:
If you want to run the demo with Angular Universal:
- `npm run demo.serve-universal`
## Compatibility
The only two dependencies are [Angular](https://angular.io) and [Bootstrap](https://getbootstrap.com) CSS.
Here is the versions compatibility list:
| ngx-bootstrap | Angular | Bootstrap CSS |
| ------------- | ------------- | -------------- |
| 5.x.x | 7.x.x - 8.x.x | 3.x.x or 4.x.x |
| 4.x.x | 6.x.x - 7.x.x | 3.x.x or 4.x.x |
| 3.x.x | 6.x.x - 7.x.x | 3.x.x or 4.x.x |
| 2.x.x | 2.x.x - 4.x.x | 3.x.x or 4.x.x |
| 1.x.x | 2.x.x | 3.x.x or 4.x.x |
## Troubleshooting
So if you are in trouble, here's where you can look for help.
......
......@@ -61,6 +61,7 @@
<li><a routerLink="." fragment="installation-instructions">Installation instructions</a></li>
<li><a routerLink="." fragment="usage--demo">Usage & Demo</a></li>
<li><a routerLink="." fragment="api">API</a></li>
<li><a routerLink="." fragment="compatibility">Compatibility</a></li>
<li><a routerLink="." fragment="troubleshooting">Troubleshooting</a></li>
<li><a routerLink="." fragment="contribution">Contributing</a></li>
<li><a routerLink="." fragment="accessibility">Accessibility</a></li>
......@@ -152,6 +153,49 @@
<p>Check demo page for API <a href="https://valor-software.com/ngx-bootstrap/">reference</a></p>
<h2 id="compatibility">Compatibility</h2>
<p>The only two dependencies are <a href="https://angular.io" target="_blank">Angular</a> and <a href="https://getbootstrap.com" target="_blank">Bootstrap</a> CSS.</p>
<p>Here is the versions compatibility list:</p>
<table class="compatibility">
<thead>
<tr>
<th>ngx-bootstrap</th>
<th>Angular</th>
<th>Bootstrap CSS</th>
</tr>
</thead>
<tbody>
<tr>
<th>5.x.x</th>
<th>7.x.x - 8.x.x</th>
<th>3.x.x or 4.x.x</th>
</tr>
<tr>
<th>4.x.x</th>
<th>6.x.x - 7.x.x</th>
<th>3.x.x or 4.x.x</th>
</tr>
<tr>
<th>3.x.x</th>
<th>6.x.x - 7.x.x</th>
<th>3.x.x or 4.x.x</th>
</tr>
<tr>
<th>2.x.x</th>
<th>2.x.x - 4.x.x</th>
<th>3.x.x or 4.x.x</th>
</tr>
<tr>
<th>1.x.x</th>
<th>2.x.x</th>
<th>3.x.x or 4.x.x</th>
</tr>
</tbody>
</table>
<h2 id="troubleshooting">Troubleshooting</h2>
<p>So you are in trouble, where to get help:</p>
......
......@@ -132,6 +132,17 @@ a:hover {
max-width: 700px;
margin: 0 auto;
}
.compatibility {
table, th, td {
text-align: left;
}
th, td {
padding: 8px;
border-bottom: 1px solid #ddd;
}
tr:hover {background-color: #dadadd;}
}
/* entry */
.entry {
padding: 75px 0 ;
......
......@@ -66,7 +66,7 @@ module.exports = function (config) {
logLevel: config.LOG_INFO,
reporters: ['dots', 'saucelabs'],
singleRun: true,
concurrency: 2,
concurrency: 4,
captureTimeout: 60000,
sauceLabs: {
testName: 'ngx-bootstrap',
......@@ -103,7 +103,7 @@ module.exports = function (config) {
'SL_SAFARI': {
base: 'SauceLabs',
browserName: 'safari',
version: 'latest-1'
version: '11'
}
}
});
......
This diff is collapsed.
......@@ -107,8 +107,8 @@ describe('start and end of units', () => {
assertEq(+m, +ma, 'Full or abbreviated should work');
assertEq(m.year(), 2011, 'keep the year');
assertEq(m.month(), 0, 'rolls back to January');
assertEq(m.day(), 0, 'set day of week');
assertEq(m.date(), 30, 'set correct date');
//assertEq(m.day(), 0, 'set day of week');
//assertEq(m.date(), 30, 'set correct date');
assertEq(m.hours(), 0, 'strip out the hours');
assertEq(m.minutes(), 0, 'strip out the minutes');
assertEq(m.seconds(), 0, 'strip out the seconds');
......@@ -123,8 +123,8 @@ describe('start and end of units', () => {
assertEq(+m, +ma, 'Full or abbreviated should work');
assertEq(m.year(), 2011, 'keep the year');
assertEq(m.month(), 1, 'keep the month');
assertEq(m.day(), 6, 'set the day of the week');
assertEq(m.date(), 5, 'set the day');
//assertEq(m.day(), 6, 'set the day of the week');
//assertEq(m.date(), 5, 'set the day');
assertEq(m.hours(), 23, 'set the hours');
assertEq(m.minutes(), 59, 'set the minutes');
assertEq(m.seconds(), 59, 'set the seconds');
......
......@@ -131,7 +131,7 @@ describe('Directive: Dropdown', () => {
expect(element.querySelector('[dropdown]').classList).toContain('open');
tick();
document.querySelector('a').click();
element.click();
fixture.detectChanges();
expect(element.querySelector('[dropdown]').classList).not.toContain('open');
}));
......@@ -197,7 +197,7 @@ describe('Directive: Dropdown', () => {
expect(element.querySelector('[dropdown]').classList).toContain('open');
tick();
document.querySelector('a').click();
element.click();
fixture.detectChanges();
expect(element.querySelector('[dropdown]').classList).toContain('open');
tick();
......@@ -240,7 +240,7 @@ describe('Directive: Dropdown', () => {
expect(element.querySelector('[dropdown]').classList).toContain('open');
tick();
document.querySelector('a').click();
element.click();
fixture.detectChanges();
expect(element.querySelector('[dropdown]').classList).toContain('open');
......
......@@ -3,6 +3,7 @@ import { asNativeElements } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { By } from '@angular/platform-browser';
import { TestBed, ComponentFixture, tick, fakeAsync } from '@angular/core/testing';
import { Subject } from 'rxjs';
import { PositioningService } from 'ngx-bootstrap/positioning';
......@@ -14,6 +15,19 @@ import {
TypeaheadOptions
} from '../typeahead';
export class PositionServiceMock {
setOptions() {
return;
}
enable() {
return;
}
get event$() {
return new Subject<any>();
}
}
describe('Component: TypeaheadContainer', () => {
let fixture: ComponentFixture<TypeaheadContainerComponent>;
......@@ -34,7 +48,8 @@ describe('Component: TypeaheadContainer', () => {
provide: TypeaheadConfig,
useValue: new TypeaheadConfig()
},
PositioningService
{ provide: PositioningService,
useClass: PositionServiceMock}
]
});
fixture = testModule.createComponent(TypeaheadContainerComponent);
......@@ -186,13 +201,6 @@ describe('Component: TypeaheadContainer', () => {
expect(matches[0].classList.contains('active')).toBeTruthy();
expect(matches[1].classList.contains('active')).toBeFalsy();
});
it('should rewrite matches', () => {
component.matches = ([new TypeaheadMatch({ id: 1, name: 'fox' }, 'fox')]);
fixture.detectChanges();
expect(component.matches.length).toBe(1);
});
});
describe('nextActiveMatch', () => {
......
......@@ -20,6 +20,7 @@ interface State {
<input [(ngModel)]="selectedState"
[typeahead]="states"
[typeaheadOptionField]="'name'"
[adaptivePosition]="false"
(typeaheadOnBlur)="onBlurEvent($event)">`
})
class TestTypeaheadComponent {
......@@ -464,15 +465,10 @@ describe('Directive: Typeahead', () => {
}));
it('should close typeahead container if Tab was clicked', fakeAsync(() => {
inputElement.value = ' ';
dispatchTouchEvent(inputElement, 'input');
tick();
directive.typeaheadSelectFirstItem = false;
directive.isActiveItemChanged = true;
inputElement.value = 'Alab';
dispatchTouchEvent(inputElement, 'input');
tick();
dispatchKeyboardEvent(inputElement, 'keydown', 'TAB');
tick();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment