Skip to content

Commit

Permalink
Revert "Revert test for failing E2E toolbar.test.tsx"
Browse files Browse the repository at this point in the history
This reverts commit d8e86df.
  • Loading branch information
TeresaGobble committed Aug 30, 2023
1 parent d8e86df commit bb1a138
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 162 deletions.
188 changes: 32 additions & 156 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions packages/faustwp-core/src/components/Toolbar/nodes/Edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ export function Edit({ seedNode }: Props) {
}

// eslint-disable-next-line no-underscore-dangle
let postType = seedNode?.__typename || '';
let postId = seedNode?.databaseId || '';
// eslint-disable-next-line no-underscore-dangle
const postType = seedNode?.__typename ?? (typeName as string | undefined);
const postId = seedNode?.databaseId ?? (p as string | undefined);

// This is a preview.
if (!postId) {
postId = p as string;
postType = typeName as string;
if (!postId || !postType) {
return null;
}

const editPostUrl = getAdminUrl(`post.php?post=${postId}&action=edit`);
Expand Down

0 comments on commit bb1a138

Please sign in to comment.