Skip to content

chore: update to angular RC4 and other update other packages #843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@
"node": ">= 4.2.1 < 5"
},
"dependencies": {
"@angular/common": "2.0.0-rc.3",
"@angular/compiler": "2.0.0-rc.3",
"@angular/core": "2.0.0-rc.3",
"@angular/http": "2.0.0-rc.3",
"@angular/platform-browser": "2.0.0-rc.3",
"@angular/platform-browser-dynamic": "2.0.0-rc.3",
"@angular/common": "2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@angular/http": "2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/router": "v3.0.0-alpha.8",
"@angular/forms": "^0.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update forms to 0.2.0?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried this, and some tests start failing. We can do that update in a separate PR.

"core-js": "^2.4.0",
"hammerjs": "^2.0.8",
"rxjs": "5.0.0-beta.6",
"systemjs": "0.19.26",
"systemjs": "0.19.31",
"zone.js": "0.6.12"
},
"devDependencies": {
"add-stream": "^1.0.0",
"angular-cli": "^1.0.0-beta.6",
"angular-cli": "^1.0.0-beta.9",
"broccoli-autoprefixer": "^4.1.0",
"broccoli-funnel": "^1.0.1",
"broccoli-merge-trees": "^1.1.1",
Expand All @@ -56,24 +56,24 @@
"glob": "^6.0.4",
"jasmine-core": "^2.4.1",
"js-yaml": "^3.5.2",
"karma": "^0.13.15",
"karma-browserstack-launcher": "^0.1.7",
"karma-chrome-launcher": "^0.2.3",
"karma-firefox-launcher": "^0.1.7",
"karma-jasmine": "^0.3.8",
"karma-sauce-launcher": "^0.2.14",
"madge": "^0.5.3",
"karma": "^1.1.1",
"karma-browserstack-launcher": "^1.0.1",
"karma-chrome-launcher": "^1.0.1",
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "^1.0.2",
"karma-sauce-launcher": "^1.0.0",
"madge": "^0.6.0",
"node-sass": "^3.4.2",
"protractor": "^3.3.0",
"protractor-accessibility-plugin": "0.1.1",
"sass": "^0.5.0",
"strip-ansi": "^3.0.0",
"stylelint": "^6.5.1",
"stylelint": "^6.9.0",
"symlink-or-copy": "^1.0.1",
"ts-node": "^0.7.3",
"tslint": "^3.5.0",
"typescript": "^1.9.0-dev",
"typings": "^1.0.4",
"tslint": "^3.13.0",
"typescript": "^2.0.0",
"typings": "^1.3.1",
"which": "^1.2.4"
}
}
16 changes: 14 additions & 2 deletions scripts/ci/build-and-test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e
set -ex

echo "======= Starting build-and-test.sh ========================================"

Expand All @@ -22,8 +22,20 @@ if is_lint; then
elif is_circular_deps_check; then
npm run check-circular-deps
elif is_e2e; then
# Start up the e2e app. This will take some time.
echo "Starting e2e app"
MD_APP=e2e ng serve &
sleep 20
sleep 1

# Wait until the dist/ directory is created, indicating that the e2e app is ready.
# Use the presence of `button.js` to determine whether the compiled output is ready to be served.
echo "Waiting for e2e app to start"
while [ ! -f ./dist/components/button/button.js ]; do
sleep 2
done

# Run the e2e tests on the served e2e app.
echo "Starting e2e tests"
ng e2e
else
karma start test/karma.conf.js --single-run --no-auto-watch --reporters='dots'
Expand Down
25 changes: 12 additions & 13 deletions src/components/button-toggle/button-toggle.spec.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import {
it,
describe,
beforeEach,
beforeEachProviders,
addProviders,
inject,
async,
fakeAsync,
tick,
} from '@angular/core/testing';
import {NgControl, disableDeprecatedForms, provideForms} from '@angular/forms';
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
import {Component, DebugElement, provide} from '@angular/core';
import {Component, DebugElement} from '@angular/core';
import {By} from '@angular/platform-browser';
import {
MD_BUTTON_TOGGLE_DIRECTIVES,
Expand All @@ -28,14 +25,16 @@ describe('MdButtonToggle', () => {
let builder: TestComponentBuilder;
let dispatcher: MdUniqueSelectionDispatcher;

beforeEachProviders(() => [
disableDeprecatedForms(),
provideForms(),
provide(MdUniqueSelectionDispatcher, {useFactory: () => {
dispatcher = new MdUniqueSelectionDispatcher();
return dispatcher;
}})
]);
beforeEach(() => {
addProviders([
disableDeprecatedForms(),
provideForms(),
{provide: MdUniqueSelectionDispatcher, useFactory: () => {
dispatcher = new MdUniqueSelectionDispatcher();
return dispatcher;
}}
]);
});

beforeEach(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
builder = tcb;
Expand Down
12 changes: 5 additions & 7 deletions src/components/button-toggle/button-toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import {
OnInit,
Optional,
Output,
Provider,
QueryList,
ViewEncapsulation,
forwardRef
} from '@angular/core';
// TODO(iveysaur): Update to @angular/forms when we have rc.2
import {
NG_VALUE_ACCESSOR,
ControlValueAccessor,
Expand All @@ -32,11 +30,11 @@ export type ToggleType = 'checkbox' | 'radio';
* Provider Expression that allows md-button-toggle-group to register as a ControlValueAccessor.
* This allows it to support [(ngModel)].
*/
export const MD_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR = new Provider(
NG_VALUE_ACCESSOR, {
useExisting: forwardRef(() => MdButtonToggleGroup),
multi: true
});
export const MD_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => MdButtonToggleGroup),
multi: true
};

var _uniqueIdCounter = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/components/button/button.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {it, describe, expect, beforeEach, inject} from '@angular/core/testing';
import {inject} from '@angular/core/testing';
import {TestComponentBuilder} from '@angular/compiler/testing';
import {Component} from '@angular/core';
import {By} from '@angular/platform-browser';
Expand Down
33 changes: 13 additions & 20 deletions src/components/checkbox/checkbox.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
it,
beforeEach,
beforeEachProviders,
addProviders,
inject,
async,
fakeAsync,
Expand All @@ -19,7 +17,6 @@ import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing'
import {Component, DebugElement} from '@angular/core';
import {By} from '@angular/platform-browser';
import {MdCheckbox, MdCheckboxChange} from './checkbox';
import {PromiseCompleter} from '@angular2-material/core/async/promise-completer';



Expand All @@ -29,10 +26,12 @@ describe('MdCheckbox', () => {
let builder: TestComponentBuilder;
let fixture: ComponentFixture<any>;

beforeEachProviders(() => [
disableDeprecatedForms(),
provideForms(),
]);
beforeEach(() => {
addProviders([
disableDeprecatedForms(),
provideForms(),
]);
});

beforeEach(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
builder = tcb;
Expand Down Expand Up @@ -215,21 +214,14 @@ describe('MdCheckbox', () => {
expect(testComponent.onCheckboxClick).toHaveBeenCalledTimes(1);
});

it('should emit a change event when the `checked` value changes', () => {
// TODO(jelbourn): this *should* work with async(), but fixture.whenStable currently doesn't
// know to look at pending macro tasks.
// See https://github.com/angular/angular/issues/8389
// As a short-term solution, use a promise (which jasmine knows how to understand).
let promiseCompleter = new PromiseCompleter();
checkboxInstance.change.subscribe(() => {
promiseCompleter.resolve();
});

it('should emit a change event when the `checked` value changes', async(() => {
testComponent.isChecked = true;
fixture.detectChanges();

return promiseCompleter.promise;
});
fixture.whenStable().then(() => {
expect(fixture.componentInstance.changeCount).toBe(1);
});
}));

describe('state transition css classes', () => {
it('should transition unchecked -> checked -> unchecked', () => {
Expand Down Expand Up @@ -509,6 +501,7 @@ class SingleCheckbox {
parentElementClicked: boolean = false;
parentElementKeyedUp: boolean = false;
lastKeydownEvent: Event = null;
changeCount: number = 0;

onCheckboxClick(event: Event) {}
}
Expand Down
11 changes: 5 additions & 6 deletions src/components/checkbox/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
EventEmitter,
Input,
Output,
Provider,
Renderer,
ViewEncapsulation,
forwardRef,
Expand All @@ -22,11 +21,11 @@ let nextId = 0;
* Provider Expression that allows md-checkbox to register as a ControlValueAccessor. This allows it
* to support [(ngModel)].
*/
export const MD_CHECKBOX_CONTROL_VALUE_ACCESSOR = new Provider(
NG_VALUE_ACCESSOR, {
useExisting: forwardRef(() => MdCheckbox),
multi: true
});
export const MD_CHECKBOX_CONTROL_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => MdCheckbox),
multi: true
};

/**
* Represents the different states that require custom transitions between them.
Expand Down
Loading