Skip to content
This repository was archived by the owner on Jan 4, 2026. It is now read-only.

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

Merged
jelbourn merged 1 commit into
angular:masterfrom
riavalon:chore-unit-tests
Apr 13, 2017
Merged

chore(tests): Add unit tests for each component.#138
jelbourn merged 1 commit into
angular:masterfrom
riavalon:chore-unit-tests

Conversation

@riavalon

Copy link
Copy Markdown
Contributor

No description provided.

@jelbourn

Copy link
Copy Markdown
Contributor

Looks like CI is failing on an scss issue

@riavalon

riavalon commented Mar 31, 2017

Copy link
Copy Markdown
ContributorAuthor

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
riavalonforce-pushed the chore-unit-tests branch 4 times, most recently from 466fdf1 to 717a1f3CompareApril 4, 2017 14:47

@jelbournjelbourn left a comment

Copy link
Copy Markdown
Contributor

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.

Comment threadpackage.json Outdated
"@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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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.

Comment threadsrc/app/shared/footer/footer.spec.ts Outdated
.querySelector('.docs-footer-links a');
const href = link.getAttribute('href');
const text = link.textContent;
expect(~href.indexOf('angular.io')).toBeTruthy();

Copy link
Copy Markdown
Contributor

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');

Comment threadsrc/app/shared/footer/footer.spec.ts Outdated
expect(text).toContain('Learn Angular');
});

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

Copy link
Copy Markdown
Contributor

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

Comment threadsrc/app/shared/navbar/navbar.spec.ts Outdated
fixture.detectChanges();
}));

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

Copy link
Copy Markdown
Contributor

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
riavalonforce-pushed the chore-unit-tests branch 6 times, most recently from b85ea7a to 616a64dCompareApril 11, 2017 17:20

@jelbournjelbourn left a comment

Copy link
Copy Markdown
Contributor

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:masterApr 13, 2017
Sign up for freeto 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

@riavalon@jelbourn@googlebot