mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 08:33:36 +00:00
refactor: address code review suggestions
- Simplify countCustomProfiles by reusing getCustomProfiles helper - Fix misleading test name and assertion for thinking level controls
This commit is contained in:
@@ -61,19 +61,8 @@ export async function getBuiltInProfiles(page: Page): Promise<Locator> {
|
||||
* Count the number of custom profiles
|
||||
*/
|
||||
export async function countCustomProfiles(page: Page): Promise<number> {
|
||||
// Count profiles by checking each one for the "Built-in" text
|
||||
const allCards = await page.locator('[data-testid^="profile-card-"]').all();
|
||||
let customCount = 0;
|
||||
|
||||
for (const card of allCards) {
|
||||
const builtInText = card.locator('text="Built-in"');
|
||||
const isBuiltIn = (await builtInText.count()) > 0;
|
||||
if (!isBuiltIn) {
|
||||
customCount++;
|
||||
}
|
||||
}
|
||||
|
||||
return customCount;
|
||||
const customProfiles = await getCustomProfiles(page);
|
||||
return customProfiles.count();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user