Skip to content
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

[select] common test suite for all components #2646

Merged
merged 6 commits into from
Jul 24, 2018
Merged

Conversation

giladgray
Copy link
Contributor

also add tests for Omnibar!

@blueprint-bot
Copy link

add Omnibar tests!

Preview: documentation | landing | table

@giladgray
Copy link
Contributor Author

😢 this suite relies on some of the new features i built for controlled usage. might have to wait till after that merges...

@blueprint-bot
Copy link

fix common tests. revert this commit to bring back controlled tests.

Preview: documentation | landing | table

@blueprint-bot
Copy link

Omnibar disable usePortal in tests

Preview: documentation | landing | table

@@ -41,6 +41,9 @@ export interface IOmnibarProps<T> extends IListItemsProps<T> {
/** Props to spread to `Overlay`. */
overlayProps?: Partial<IOverlayProps>;

/** The query string. */
query?: string;
Copy link
Member

Choose a reason for hiding this comment

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

should this be initialQuery given that changes are not respected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i'm planning to change this immediately after merge with the whole un/controlled feature, so let's keep it to this name so it's not "breaking"

@@ -159,6 +159,7 @@ export class Suggest<T> extends React.PureComponent<ISuggestProps<T>, ISuggestSt

this.selectText();

// TODO Popover.openOnTargetFocus?
Copy link
Member

Choose a reason for hiding this comment

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

?

Copy link
Contributor

Choose a reason for hiding this comment

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

+?

onActiveItemChange: sinon.spy(),
onItemSelect: sinon.spy(),
renderer: sinon.spy(() => <div />), // must render something,
renderer: sinon.spy((props: IQueryListRendererProps<IFilm>) => <div>{props.itemList}</div>), // must render something,
Copy link
Member

Choose a reason for hiding this comment

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

no need for this comment now

assert.isFalse(wrapper.state().isOpen, "popover should not open on focus");
// TODO fix later
// simulateFocus(wrapper);
// assert.isFalse(wrapper.state().isOpen, "popover should not open on focus");
Copy link
Member

Choose a reason for hiding this comment

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

when is later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@themadcreator themadcreator left a comment

Choose a reason for hiding this comment

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

Minor comments. Also echo @invliD's comments

@@ -159,6 +159,7 @@ export class Suggest<T> extends React.PureComponent<ISuggestProps<T>, ISuggestSt

this.selectText();

// TODO Popover.openOnTargetFocus?
Copy link
Contributor

Choose a reason for hiding this comment

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

+?

@@ -53,7 +64,7 @@ describe("Suggest", () => {
runEscTabKeyDownTests(Keys.TAB);
});

it("does not open popover on BACKSPACE, ARROW_LEFT, or ARROW_RIGHT", () => {
xit("does not open popover on BACKSPACE, ARROW_LEFT, or ARROW_RIGHT", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this now disabled? Leave comment at minimum

@blueprint-bot
Copy link

comments

Preview: documentation | landing | table

@giladgray giladgray merged commit 39df990 into develop Jul 24, 2018
@giladgray giladgray deleted the gg/select-tests branch July 24, 2018 22:25
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