Skip to content

Commit 6f127ff

Browse files
committed
Try to fix the e2e test.
1 parent 25195f6 commit 6f127ff

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

tests/e2e/sequential/task-tagline.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function taglineTests( testContext = test ) {
2222

2323
// Find the blog description task
2424
const blogDescriptionTask = initialTasks.find(
25-
( task ) => task.slug === 'core-blogdescription'
25+
( task ) => task.post_name === 'core-blogdescription'
2626
);
2727
expect( blogDescriptionTask ).toBeDefined();
2828
expect( blogDescriptionTask.post_status ).toBe( 'publish' );

tests/e2e/task-dismissible.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ test.describe( 'PRPL Dismissable Tasks', () => {
5353

5454
// Find the completed task
5555
const completedTask = completedTasks.find(
56-
( task ) => task.task_id === taskId
56+
( task ) => task.post_name === taskId
5757
);
5858
expect( completedTask ).toBeDefined();
5959
expect( completedTask.post_status ).toBe( 'trash' );

tests/e2e/task-snooze.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ test.describe( 'PRPL Task Snooze', () => {
2222

2323
// Find a task that's not completed or snoozed
2424
const taskToSnooze = initialTasks.find(
25-
( task ) => task.task_id === snoozeTaskId
25+
( task ) => task.post_name === snoozeTaskId
2626
);
2727

2828
if ( taskToSnooze ) {
2929
// Hover over the task to show actions
3030
const taskElement = page.locator(
31-
`li[data-task-id="${ taskToSnooze.task_id }"]`
31+
`li[data-task-id="${ taskToSnooze.post_name }"]`
3232
);
3333
await taskElement.hover();
3434

@@ -47,7 +47,7 @@ test.describe( 'PRPL Task Snooze', () => {
4747
// Select 1 week duration by clicking the label
4848
await page.evaluate( ( taskToBeSnoozed ) => {
4949
const radio = document.querySelector(
50-
`li[data-task-id="${ taskToBeSnoozed.task_id }"] .prpl-snooze-duration-radio-group input[type="radio"][value="1-week"]`
50+
`li[data-task-id="${ taskToBeSnoozed.post_name }"] .prpl-snooze-duration-radio-group input[type="radio"][value="1-week"]`
5151
);
5252
const label = radio.closest( 'label' );
5353
label.click();
@@ -67,7 +67,7 @@ test.describe( 'PRPL Task Snooze', () => {
6767
);
6868
const updatedTasks = await updatedResponse.json();
6969
const updatedTask = updatedTasks.find(
70-
( task ) => task.task_id === taskToSnooze.task_id
70+
( task ) => task.post_name === taskToSnooze.post_name
7171
);
7272
expect( updatedTask.post_status ).toBe( 'future' );
7373
}

0 commit comments

Comments
 (0)