Skip to content
This repository was archived by the owner on Nov 1, 2019. It is now read-only.

<Dialog /> - Basic Implementation - #494

Open
liorzisman wants to merge 98 commits into
masterfrom
liorzisman/dialog
Open

<Dialog /> - Basic Implementation#494
liorzisman wants to merge 98 commits into
masterfrom
liorzisman/dialog

Conversation

@liorzisman

Copy link
Copy Markdown
Contributor

Keep in mind driver creation will be done in the next phase of development as some requirements are currently missing

@liorzisman liorzisman self-assigned this Oct 19, 2017
@liorzisman liorzisman changed the title <Dialog /> - Basic Implementation <Dialog /> - Basic Implementation + Oct 22, 2017
@liorzisman liorzisman changed the title <Dialog /> - Basic Implementation + <Dialog /> - Basic Implementation + Modal Test Driver Oct 22, 2017
@liorzisman liorzisman changed the title <Dialog /> - Basic Implementation + Modal Test Driver <Dialog /> - Basic Implementation Oct 22, 2017
Comment thread src/components/dialog/dialog.st.css Outdated
.header {
border-bottom: 1px solid black;
width: calc(100% + 10px);
margin-left: -5px;

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.

Maybe change all these 5 pixel distances into a variable if they're connected... or try to refactor so that they're unnecessary, if possible.


afterEach(() => clientRenderer.cleanup());

it('opens the dialog upon extra button click, and closes it upon clicking any of the buttons', async () => {

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.

upon extra button click

This wording could maybe be more clear.

}

private getDialogElement(elem: string): Element {
return this.select(this.root.getAttribute('data-automation-id')!, elem);

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.

It seems to me like if you're fetching an element from the MODAL content you should rely on the modal driver to do it.


afterEach(() => clientRenderer.cleanup());

it('opens the dialog upon extra button click, and closes it upon clicking any of the buttons', async () => {

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.

what does extra mean

return this.getDialogElement('DIALOG_TITLE');
}

public getButton(type: DialogButtonType) {

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.

type


await waitForDom(() => expect(dialogDemo.dialog).to.be.present());

(dialogDriver.getButton('CLOSE') as HTMLButtonElement).click();

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 that the casting will not be required if the getButton method was typed

isOpen: false,
onCancel: noop,
onOk: noop,
title: 'Dialog'

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 would avoid a default here

return this.modalDriver.children[0];
}

public get title(): Element {

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 would expect this method to return string (the title text itself)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants