Skip to content

Conversation

@sarupbanskota
Copy link
Contributor

@sarupbanskota sarupbanskota commented Dec 23, 2016

Closes #776
Also under #697

import { count, text, isHidden } from 'ember-cli-page-object';

export default {
scope : '.user-sidebar',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

could it be because count('.user-sidebar') will look for .user-sidebar within the scope (which is .user-sidebar)?

Copy link
Contributor

@begedin begedin 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. Only a couple of minor changes and then we're good to go.

assert.equal(this.$('li.twitter a').attr('href'), 'https://twitter.com/joshsmith', 'The twitter link renders');
assert.equal(this.$('li.website').text().trim(), 'https://codecorps.org', 'Their website renders');
assert.equal(this.$('li.website a').attr('href'), 'https://codecorps.org', 'The website link renders');
assert.equal(page.userSidebarCount, 1, 'Component\'s element is rendered');
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't really need this assertion at all.

export default {
scope : '.user-sidebar',

userSidebarCount : isVisible(),
Copy link
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 this property. I would name it userSidebarVisible or userSidebarRendered in context, but if the removal of the "it renders" test above and the one assertion in the other test means we no longer use this property, just remove it from here.

twitterHandleHidden : isHidden('li.twitter'),
websiteHidden : isHidden('li.website'),
twitterLink : property('href', 'li.twitter a'),
websiteLink : property('href', 'li.website a')
Copy link
Contributor

Choose a reason for hiding this comment

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

There are arguments for this type of formatting/spacing, but we don't use it anywhere in the app ourselves, so we would prefer if you switched this to just using a single space instead of horizontally aligning the values.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

alright cool. I was actually supposed to introduce that with #653 which got stale and I'll do another PR, but I thought I should do it once the remaining of my PRs are merged.

@sarupbanskota
Copy link
Contributor Author

@begedin thanks for the feedback! NY time so a bit slow, but I should clear this up in a day or two.

@joshsmith joshsmith force-pushed the tests/page-object-user-sidebar branch from 1f6e413 to 9d10c59 Compare January 25, 2017 22:33
@joshsmith joshsmith requested review from begedin and removed request for joshsmith January 25, 2017 22:33
@joshsmith joshsmith force-pushed the tests/page-object-user-sidebar branch from 9d10c59 to e975e9c Compare January 25, 2017 22:53
@joshsmith joshsmith merged commit 6d133e5 into develop Jan 25, 2017
@joshsmith joshsmith deleted the tests/page-object-user-sidebar branch January 25, 2017 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants