Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

chore(tests): Add unit tests for each component. #138

Merged
merged 1 commit into from
Apr 13, 2017

Conversation

riavalon
Copy link
Contributor

No description provided.

@jelbourn
Copy link
Member

Looks like CI is failing on an scss issue

@riavalon
Copy link
Contributor Author

riavalon commented Mar 31, 2017

I believe the scss issue was due to it building with @angular/material set to beta 1 instead of 2. There is an issue with one of the tests not passing on the ci now, and I'm looking into it 👍

@riavalon riavalon force-pushed the chore-unit-tests branch 4 times, most recently from 466fdf1 to 717a1f3 Compare April 4, 2017 14:47
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

Looks good, just a few tests that I think we can cut.

package.json Outdated
@@ -21,7 +21,7 @@
"@angular/core": "^2.4.6",
"@angular/forms": "^2.4.6",
"@angular/http": "^2.4.6",
"@angular/material": "^2.0.0-beta.1",
"@angular/material": "^2.0.0-beta.2",
Copy link
Member

Choose a reason for hiding this comment

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

Can revert this line now that we're on beta.3

fixture.detectChanges();
}));

it('should render four rows of content on the homepage', () => {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need these homepage tests since it's all just static content.

.querySelector('.docs-footer-links a');
const href = link.getAttribute('href');
const text = link.textContent;
expect(~href.indexOf('angular.io')).toBeTruthy();
Copy link
Member

Choose a reason for hiding this comment

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

Should be able to do

expect(href).toContain('angular.io');

expect(text).toContain('Learn Angular');
});

it('should show an angular logo in the footer', () => {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think a test for the this is necessary

fixture.detectChanges();
}));

it('should have four main links', () => {
Copy link
Member

Choose a reason for hiding this comment

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

I think this test also isn't needed

@riavalon riavalon force-pushed the chore-unit-tests branch 6 times, most recently from b85ea7a to 616a64d Compare April 11, 2017 17:20
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn merged commit fd8d1ea into angular:master Apr 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants