-
Notifications
You must be signed in to change notification settings - Fork 48
chore: check if checkbox is checked #63
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
Conversation
assets/demo-todo-app.spec.js
Outdated
@@ -168,13 +168,20 @@ test.describe('Item', () => { | |||
|
|||
const firstTodo = page.getByTestId('todo-item').nth(0); | |||
const secondTodo = page.getByTestId('todo-item').nth(1); | |||
await firstTodo.getByRole('checkbox').check(); | |||
const firstTodoCheck = firstTodo.getByRole('checkbox'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const firstTodoCheck = firstTodo.getByRole('checkbox'); | |
const firstTodoCheckbox = firstTodo.getByRole('checkbox'); |
don't call it Check, call it Checkbox
assets/demo-todo-app.spec.js
Outdated
const secondTodoCheck = secondTodo.getByRole('checkbox'); | ||
|
||
await firstTodoCheck.check(); | ||
await expect(firstTodoCheck).toBeChecked(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this assertion does not make a lot of sense, since a checkbox is always checked if you check it. Isn't asserting for the completed class already enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok perhaps. no idea to be honest.
assets/demo-todo-app.spec.js
Outdated
@@ -168,12 +168,15 @@ test.describe('Item', () => { | |||
|
|||
const firstTodo = page.getByTestId('todo-item').nth(0); | |||
const secondTodo = page.getByTestId('todo-item').nth(1); | |||
await firstTodo.getByRole('checkbox').check(); | |||
const firstTodoCheckbox = firstTodo.getByRole('checkbox'); | |||
const secondTodoCheckbox = secondTodo.getByRole('checkbox'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused?
assets/demo-todo-app.spec.js
Outdated
@@ -317,8 +320,10 @@ test.describe('Persistence', () => { | |||
} | |||
|
|||
const todoItems = page.getByTestId('todo-item'); | |||
await todoItems.nth(0).getByRole('checkbox').check(); | |||
const firstTodoCheck = todoItems.nth(0).getByRole('checkbox') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const firstTodoCheck = todoItems.nth(0).getByRole('checkbox') | |
const firstTodoCheck = todoItems.nth(0).getByRole('checkbox'); |
assets/demo-todo-app.spec.ts
Outdated
@@ -167,12 +167,15 @@ test.describe('Item', () => { | |||
|
|||
const firstTodo = page.getByTestId('todo-item').nth(0); | |||
const secondTodo = page.getByTestId('todo-item').nth(1); | |||
await firstTodo.getByRole('checkbox').check(); | |||
const firstTodoCheckbox = firstTodo.getByRole('checkbox'); | |||
const secondTodoCheckbox = secondTodo.getByRole('checkbox'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused!
assets/demo-todo-app.spec.ts
Outdated
@@ -316,8 +319,10 @@ test.describe('Persistence', () => { | |||
} | |||
|
|||
const todoItems = page.getByTestId('todo-item'); | |||
await todoItems.nth(0).getByRole('checkbox').check(); | |||
const firstTodoCheck = todoItems.nth(0).getByRole('checkbox') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const firstTodoCheck = todoItems.nth(0).getByRole('checkbox') | |
const firstTodoCheck = todoItems.nth(0).getByRole('checkbox'); |
No description provided.