ronantakizawa/codereview-bench huggingface dataset:
Repository: catchorg/Catch2
File: src/catch2/reporters/catch_reporter_automake.hpp (C++)

Code before:

//              Copyright Catch2 Authors
// Distributed under the Boost Software License, Version 1.0.
//   (See accompanying file LICENSE_1_0.txt or copy at
//        https://www.boost.org/LICENSE_1_0.txt)

// SPDX-License-Identifier: BSL-1.0
#ifndef CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
#define CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED

#include <catch2/interfaces/catch_interfaces_reporter.hpp>
#include <catch2/reporters/catch_reporter_streaming_base.hpp>
#include <catch2/internal/catch_move_and_forward.hpp>

#include <string>

namespace Catch {

    class AutomakeReporter final : public StreamingReporterBase {
    public:
        AutomakeReporter(ReporterConfig&& _config):
            StreamingReporterBase(CATCH_MOVE(_config))
        {}
        ~AutomakeReporter() override;

        static std::string getDescription() {
            using namespace std::string_literals;
            return "Reports test results in the format of Automake .trs files"s;
        }

        void testCaseEnded(TestCaseStats const& _testCaseStats) override;
        void skipTest(TestCaseInfo const& testInfo) override;
    };

} // end namespace Catch

#endif // CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED


Review comment (suggestion):
```suggestion
        // GCC5 compat: we cannot use inherited constructor, because it
        //              doesn't implement backport of P0136
        AutomakeReporter(ReporterConfig&& _config):
```

Code after:

//              Copyright Catch2 Authors
// Distributed under the Boost Software License, Version 1.0.
//   (See accompanying file LICENSE_1_0.txt or copy at
//        https://www.boost.org/LICENSE_1_0.txt)

// SPDX-License-Identifier: BSL-1.0
#ifndef CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
#define CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED

#include <catch2/interfaces/catch_interfaces_reporter.hpp>
#include <catch2/reporters/catch_reporter_streaming_base.hpp>
#include <catch2/internal/catch_move_and_forward.hpp>

#include <string>

namespace Catch {

    class AutomakeReporter final : public StreamingReporterBase {
    public:
        // GCC5 compat: we cannot use inherited constructor, because it
        //              doesn't implement backport of P0136
        AutomakeReporter(ReporterConfig&& _config):
            StreamingReporterBase(CATCH_MOVE(_config))
        {}
        ~AutomakeReporter() override;

        static std::string getDescription() {
            using namespace std::string_literals;
            return "Reports test results in the format of Automake .trs files"s;
        }

        void testCaseEnded(TestCaseStats const& _testCaseStats) override;
        void skipTest(TestCaseInfo const& testInfo) override;
    };

} // end namespace Catch

#endif // CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
Repository: catchorg/Catch2
File: include/internal/catch_default_main.hpp (C++)

Code before:
/*
 *  Created by Phil on 20/05/2011.
 *  Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
 *
 *  Distributed under the Boost Software License, Version 1.0. (See accompanying
 *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 */
#ifndef TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED
#define TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED

#include "catch_session.h"
#include "catch_platform.h"

#ifndef __OBJC__

#if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
// Standard C/C++ Win32 Unicode wmain entry point
extern "C" int __cdecl wmain (int argc, wchar_t * argv[], wchar_t * []) {
#else
// Standard C/C++ main entry point
int main (int argc, char * argv[]) {
#endif

    return Catch::Session().run( argc, argv );
}

#else // __OBJC__

// Objective-C entry point
int main (int argc, char * const argv[]) {
#if !CATCH_ARC_ENABLED
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
#endif

    Catch::registerTestMethods();
    int result = Catch::Session().run( argc, (char**)argv );

#if !CATCH_ARC_ENABLED
    [pool drain];
#endif

    return result;
}

Review comment (suggestion):
Are there compilers that support wmain but don't have __cdecl? If so, we'd need to chain to another define, such as:

```c++
#ifndef CDECL
#ifdef MSVC
#define CDECL __cdecl
#else
#define CDECL
#endif
#endif
```


Code after:
/*
 *  Created by Phil on 20/05/2011.
 *  Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
 *
 *  Distributed under the Boost Software License, Version 1.0. (See accompanying
 *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 */
#ifndef TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED
#define TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED

#include "catch_session.h"
#include "catch_platform.h"

#ifndef __OBJC__

#ifndef CATCH_INTERNAL_CDECL
#ifdef _MSC_VER
#define CATCH_INTERNAL_CDECL __cdecl
#else
#define CATCH_INTERNAL_CDECL
#endif
#endif

#if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
// Standard C/C++ Win32 Unicode wmain entry point
extern "C" int CATCH_INTERNAL_CDECL wmain (int argc, wchar_t * argv[], wchar_t * []) {
#else
// Standard C/C++ main entry point
int CATCH_INTERNAL_CDECL main (int argc, char * argv[]) {
#endif

    return Catch::Session().run( argc, argv );
}

#else // __OBJC__

// Objective-C entry point
int main (int argc, char * const argv[]) {
#if !CATCH_ARC_ENABLED
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
#endif

    Catch::registerTestMethods();
Repository: catchorg/Catch2
File: include/internal/catch_default_main.hpp (C++)

Code before:
/*
 *  Created by Phil on 20/05/2011.
 *  Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
 *
 *  Distributed under the Boost Software License, Version 1.0. (See accompanying
 *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 */
#ifndef TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED
#define TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED

#include "catch_session.h"
#include "catch_platform.h"

#ifndef __OBJC__

#ifndef CDECL
#ifdef _MSC_VER
#define CDECL __cdecl
#else
#define CDECL
#endif
#endif

#if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
// Standard C/C++ Win32 Unicode wmain entry point
extern "C" int CDECL wmain (int argc, wchar_t * argv[], wchar_t * []) {
#else
// Standard C/C++ main entry point
int CDECL main (int argc, char * argv[]) {
#endif

    return Catch::Session().run( argc, argv );
}

#else // __OBJC__

// Objective-C entry point
int main (int argc, char * const argv[]) {
#if !CATCH_ARC_ENABLED
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
#endif

Review comment (suggestion):
I don't like unnamespaced macros, so I would prefer this to be

```suggestion
#ifndef CATCH_INTERNAL_CDECL
```


Code after:
/*
 *  Created by Phil on 20/05/2011.
 *  Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
 *
 *  Distributed under the Boost Software License, Version 1.0. (See accompanying
 *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 */
#ifndef TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED
#define TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED

#include "catch_session.h"
#include "catch_platform.h"

#ifndef __OBJC__

#ifndef CATCH_INTERNAL_CDECL
#ifdef _MSC_VER
#define CATCH_INTERNAL_CDECL __cdecl
#else
#define CATCH_INTERNAL_CDECL
#endif
#endif

#if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
// Standard C/C++ Win32 Unicode wmain entry point
extern "C" int CATCH_INTERNAL_CDECL wmain (int argc, wchar_t * argv[], wchar_t * []) {
#else
// Standard C/C++ main entry point
int CATCH_INTERNAL_CDECL main (int argc, char * argv[]) {
#endif

    return Catch::Session().run( argc, argv );
}

#else // __OBJC__

// Objective-C entry point
int main (int argc, char * const argv[]) {
#if !CATCH_ARC_ENABLED
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
#endif
Repository: catchorg/Catch2
File: include/internal/catch_default_main.hpp (C++)

Code before:
/*
 *  Created by Phil on 20/05/2011.
 *  Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
 *
 *  Distributed under the Boost Software License, Version 1.0. (See accompanying
 *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 */
#ifndef TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED
#define TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED

#include "catch_session.h"
#include "catch_platform.h"

#ifndef __OBJC__

#if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
// Standard C/C++ Win32 Unicode wmain entry point
extern "C" int wmain (int argc, wchar_t * argv[], wchar_t * []) {
#else
// Standard C/C++ main entry point
int main (int argc, char * argv[]) {
#endif

    return Catch::Session().run( argc, argv );
}

#else // __OBJC__

// Objective-C entry point
int main (int argc, char * const argv[]) {
#if !CATCH_ARC_ENABLED
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
#endif

    Catch::registerTestMethods();
    int result = Catch::Session().run( argc, (char**)argv );

#if !CATCH_ARC_ENABLED
    [pool drain];
#endif

    return result;

Review comment (suggestion):
IMO it would be a good idea to additionally constrain this even more to just 32bit x86 with the [predefined macro _M_IX86](https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170).

> `_M_IX86` Defined as the integer literal value 600 for compilations that target x86 processors. This macro isn't defined for x64 or ARM compilation targets.

Code after:
/*
 *  Created by Phil on 20/05/2011.
 *  Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
 *
 *  Distributed under the Boost Software License, Version 1.0. (See accompanying
 *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 */
#ifndef TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED
#define TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED

#include "catch_session.h"
#include "catch_platform.h"

#ifndef __OBJC__

#ifndef CATCH_INTERNAL_CDECL
#ifdef _MSC_VER
#define CATCH_INTERNAL_CDECL __cdecl
#else
#define CATCH_INTERNAL_CDECL
#endif
#endif

#if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
// Standard C/C++ Win32 Unicode wmain entry point
extern "C" int CATCH_INTERNAL_CDECL wmain (int argc, wchar_t * argv[], wchar_t * []) {
#else
// Standard C/C++ main entry point
int CATCH_INTERNAL_CDECL main (int argc, char * argv[]) {
#endif

    return Catch::Session().run( argc, argv );
}

#else // __OBJC__

// Objective-C entry point
int main (int argc, char * const argv[]) {
#if !CATCH_ARC_ENABLED
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
#endif
Repository: catchorg/Catch2
File: src/catch2/internal/catch_getenv.cpp (C++)

Code before:

//              Copyright Catch2 Authors
// Distributed under the Boost Software License, Version 1.0.
//   (See accompanying file LICENSE.txt or copy at
//        https://www.boost.org/LICENSE_1_0.txt)

// SPDX-License-Identifier: BSL-1.0

#include <catch2/internal/catch_getenv.hpp>
#include <catch2/internal/catch_platform.hpp>

#include <cstdlib>

namespace Catch {
    namespace Detail {

#if ! defined (CATCH_CONFIG_GETENV)
        char const* getEnv( char const* ) { return nullptr; }
#else

        char const* getEnv( char const* varName ) {
#    if defined( _MSC_VER )
#        pragma warning( push )
#        pragma warning( disable : 4996 ) // use getenv_s instead of getenv
#    endif

            return std::getenv( varName );

#    if defined( _MSC_VER )
#        pragma warning( pop )
#    endif
        }
#endif
} // namespace Detail
} // namespace Catch


Review comment (suggestion):
```suggestion
#if !defined (CATCH_CONFIG_GETENV)
```

just a stylistic nit

Code after:

//              Copyright Catch2 Authors
// Distributed under the Boost Software License, Version 1.0.
//   (See accompanying file LICENSE.txt or copy at
//        https://www.boost.org/LICENSE_1_0.txt)

// SPDX-License-Identifier: BSL-1.0

#include <catch2/internal/catch_getenv.hpp>

#include <catch2/internal/catch_platform.hpp>
#include <catch2/internal/catch_compiler_capabilities.hpp>

#include <cstdlib>

namespace Catch {
    namespace Detail {

#if !defined (CATCH_CONFIG_GETENV)
        char const* getEnv( char const* ) { return nullptr; }
#else

        char const* getEnv( char const* varName ) {
#    if defined( _MSC_VER )
#        pragma warning( push )
#        pragma warning( disable : 4996 ) // use getenv_s instead of getenv
#    endif

            return std::getenv( varName );

#    if defined( _MSC_VER )
#        pragma warning( pop )
#    endif
        }
#endif
} // namespace Detail
} // namespace Catch
Repository: cisagov/RedEye
File: applications/client/src/views/Campaign/Explore/Panels/Comment/Comments.tsx (TypeScript)

Code before:
						index: state.scrollToIndex!,
						align: 'start',
						behavior: 'smooth',
					});
					setTimeout(() => {
						state.update('scrollToIndex', undefined);
						store.campaign.commentStore.setScrollToComment(undefined);
					}, 1000);
				}, 250);
			}
		}
	}, [commandGroupIdData]);

	return (
		<VirtualizedList
			rangeChanged={(visibleRange) => state.update('visibleRange', visibleRange)}
			listRef={listRef}
			cy-test="comments-view"
		>
			{commandGroupIdData?.commandGroupIds?.length === 0 ? (
				isLoading ? (
					<ProgressBar intent={Intent.PRIMARY} />
				) : (
					<MessageRow>No comments</MessageRow>
				)
			) : (
				commandGroupIdData?.commandGroupIds?.map((commandGroupId) => (
					<CommentGroup
						cy-test="comment-group"
						key={commandGroupId}
						commandGroupId={commandGroupId}
						toggleNewComment={state.toggleNewComment}
						newComment={state.newComment}
						expandedCommandIDs={state.expandedCommandIDs}
						removeExpandedCommandID={state.removeExpandedCommandID}
					/>
				))
			)}
		</VirtualizedList>
	);
});

type CommandGroupIdData = { commandGroupIds: UUID[] };


Review comment (suggestion):
> Using the gt.redeye file, I clicked into Explorer Mode, then the Comments tab. If you click on Favorited Comments, which has 0, the page looks like it's continuously loading but never does. We saw this in a previous PR and it was resolved, so whatever fixed that behavior must have been affected. No console errors.

- [x] Fix this: caused by the new render logic in the `Comments` return. It doesn't account for if there are 0 comments.

Code after:
				setTimeout(() => {
					listRef?.current?.scrollToIndex({
						index: state.scrollToIndex!,
						align: 'start',
						behavior: 'smooth',
					});
					setTimeout(() => {
						state.update('scrollToIndex', undefined);
						store.campaign.commentStore.setScrollToComment(undefined);
					}, 1000);
				}, 250);
			}
		}
	}, [commandGroupIdData]);

	return (
		<VirtualizedList
			rangeChanged={(visibleRange) => state.update('visibleRange', visibleRange)}
			listRef={listRef}
			cy-test="comments-view"
		>
			{!commandGroupIdData?.commandGroupIds ? (
				<ProgressBar intent={Intent.PRIMARY} />
			) : commandGroupIdData?.commandGroupIds?.length === 0 ? (
				<MessageRow>No comments</MessageRow>
			) : (
				commandGroupIdData?.commandGroupIds?.map((commandGroupId) => (
					<CommentGroup
						cy-test="comment-group"
						key={commandGroupId}
						commandGroupId={commandGroupId}
						toggleNewComment={state.toggleNewComment}
						newComment={state.newComment}
						expandedCommandIDs={state.expandedCommandIDs}
						removeExpandedCommandID={state.removeExpandedCommandID}
					/>
				))
			)}
		</VirtualizedList>
	);
});

type CommandGroupIdData = { commandGroupIds: UUID[] };
Repository: cloudflare/wildebeest
File: backend/src/errors/index.ts (TypeScript)

Code before:
type ErrorResponse = {
	error: string
	error_description?: string
}

const headers = {
	'Access-Control-Allow-Origin': '*',
	'Access-Control-Allow-Headers': 'content-type, authorization',
	'content-type': 'application/json',
} as const

function generateErrorResponse(error: string | Error, status: number, errorDescription?: string): Response {
	let res: Error | ErrorResponse
	if (error instanceof Error) {
		res = error
	} else {
		res = {
			error: `${error}. ` + 'If the problem persists please contact your instance administrator.',
			...(errorDescription ? { error_description: errorDescription } : {}),
		}
	}
	return new Response(JSON.stringify(res), { headers, status })
}

export function notAuthorized(error: string, descr?: string): Response {
	return generateErrorResponse(`An error occurred (${error})`, 401, descr)
}

export function domainNotAuthorized(): Response {
	return generateErrorResponse(`Domain is not authorizated`, 403)
}

export function userConflict(): Response {
	return generateErrorResponse(`User already exists or conflicts`, 403)
}

export function timelineMissing(): Response {
	return generateErrorResponse(`The timeline is invalid or being regenerated`, 404)
}


Review comment (suggestion):
i'm not a huge fan of that. I would keep the same behavior as currently. console.log the error and return a generate error or error.message.

Code after:
type ErrorResponse = {
	error: string
	error_description?: string
}

const headers = {
	'Access-Control-Allow-Origin': '*',
	'Access-Control-Allow-Headers': 'content-type, authorization',
	'content-type': 'application/json',
} as const

function generateErrorResponse(error: string, status: number, errorDescription?: string): Response {
	const res: ErrorResponse = {
		error: `${error}. If the problem persists please contact your instance administrator.`,
		...(errorDescription ? { error_description: errorDescription } : {}),
	}
	return new Response(JSON.stringify(res), { headers, status })
}

export function notAuthorized(error: string, descr?: string): Response {
	return generateErrorResponse(`An error occurred (${error})`, 401, descr)
}

export function domainNotAuthorized(): Response {
	return generateErrorResponse(`Domain is not authorizated`, 403)
}

export function userConflict(): Response {
	return generateErrorResponse(`User already exists or conflicts`, 403)
}

export function timelineMissing(): Response {
	return generateErrorResponse(`The timeline is invalid or being regenerated`, 404)
}

export function clientUnknown(): Response {
	return generateErrorResponse(`The client is unknown or invalid`, 403)
}

export function internalServerError(): Response {
Repository: cloudflare/wildebeest
File: frontend/src/routes/(frontend)/explore/layout.tsx (TypeScript)

Code before:
					{linkText}
				</Link>
			</div>
		)
	}

	const links = [
		{
			linkText: 'Posts',
			linkTarget: '/explore',
		},
		{
			linkText: 'Hashtags',
			linkTarget: '/explore/tags',
		},
		{
			linkText: 'News',
			linkTarget: '/explore/links',
		},
	]

	return (
		<div class="explore-wrapper flex flex-col">
			<StickyHeader>
				<h2 class="text-reg text-md m-0 p-4 bg-wildebeest-700 xl:rounded-t">
					<i style={{ width: '20px', height: '16px' }} class="fa fa-hashtag fa-fw mr-3" />
					<span>Explore</span>
				</h2>
			</StickyHeader>
			<div class="bg-wildebeest-800 flex justify-around">{links.map((link) => renderNavLink(link))}</div>
			<div class="flex-auto">
				<Slot />
			</div>
		</div>
	)
})


Review comment (suggestion):
```suggestion
					<i class="fa fa-hashtag fa-fw mr-3 w-5 h-4" />
```

Code after:
					{linkText}
				</Link>
			</div>
		)
	}

	const links = [
		{
			linkText: 'Posts',
			linkTarget: '/explore',
		},
		{
			linkText: 'Hashtags',
			linkTarget: '/explore/tags',
		},
		{
			linkText: 'News',
			linkTarget: '/explore/links',
		},
	]

	return (
		<div class="explore-wrapper flex flex-col">
			<StickyHeader>
				<h2 class="text-reg text-md m-0 p-4 bg-wildebeest-700 xl:rounded-t">
					<i style={{ width: '1.25rem', height: '1rem' }} class="fa fa-hashtag fa-fw mr-3 w-5 h-4" />
					<span>Explore</span>
				</h2>
			</StickyHeader>
			<div class="bg-wildebeest-800 flex justify-around">{links.map((link) => renderNavLink(link))}</div>
			<div class="flex-auto">
				<Slot />
			</div>
		</div>
	)
})
Repository: cloudflare/wildebeest
File: frontend/test/posts-page.spec.ts (TypeScript)

Code before:
describe('Posts timeline page', () => {
	it('should display a list of statuses for the home page', async () => {
		const response = await fetch('http://0.0.0.0:6868/')
		expect(response.status).toBe(200)
		const body = await response.text()
		expect(body).toContain("I'll be House Speaker")
	})

	it('should display a list of statuses for the explore page', async () => {
		const response = await fetch('http://0.0.0.0:6868/explore/')
		expect(response.status).toBe(200)
		const body = await response.text()
		expect(body).toContain("I'll be House Speaker")
	})
})

describe('Toot details', () => {
	it('should show an individual toot', async () => {
		// Find a specific toot in the list
		const exploreResponse = await fetch('http://0.0.0.0:6868/explore/')
		const exploreBody = await exploreResponse.text()
		const match = exploreBody.match(/href="\/(@georgetakei\/[0-9a-z-]*)"/)
		if (!match || !match[1]) fail()

		// Fetch the page for it and validate the result
		const tootPath = match[1]
		const response = await fetch(`http://0.0.0.0:6868/${tootPath}`)
		expect(response.status).toBe(200)
		const body = await response.text()
		expect(body).toContain("I'll be House Speaker")
	})
})


Review comment (bug):
I think that `fail()` calls like this generate more generic/difficult to diagnose failures, I think something like this could be clearer both from a code point of view and for failure diagnosing:
```suggestion
		const match = exploreBody.match(/href="\/(@georgetakei\/[0-9a-z-]*)"/)
		const tootPath = match?.[1]
		expect(tootPath).toBeTruthy()
		
		// Fetch the page for it and validate the result
```

what do you think?

Code after:
describe('Posts timeline page', () => {
	it('should display a list of statuses for the home page', async () => {
		const response = await fetch('http://0.0.0.0:6868/')
		expect(response.status).toBe(200)
		const body = await response.text()
		expect(body).toContain("I'll be House Speaker")
	})

	it('should display a list of statuses for the explore page', async () => {
		const response = await fetch('http://0.0.0.0:6868/explore/')
		expect(response.status).toBe(200)
		const body = await response.text()
		expect(body).toContain("I'll be House Speaker")
	})
})

describe('Toot details', () => {
	it('should show an individual toot', async () => {
		// Find a specific toot in the list
		const exploreResponse = await fetch('http://0.0.0.0:6868/explore/')
		const exploreBody = await exploreResponse.text()
		const match = exploreBody.match(/href="\/(@georgetakei\/[0-9a-z-]*)"/)

		// Fetch the page for it and validate the result
		const tootPath = match?.[1]
		expect(tootPath).toBeTruthy()
		const response = await fetch(`http://0.0.0.0:6868/${tootPath}`)
		expect(response.status).toBe(200)
		const body = await response.text()
		expect(body).toContain("I'll be House Speaker")
	})
})