-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34d8057
commit 0730ef7
Showing
14 changed files
with
16,746 additions
and
1,020 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { ApplicationConfig, provideZoneChangeDetection } from "@angular/core"; | ||
import { provideRouter } from "@angular/router"; | ||
import { routes } from "./app.routes"; | ||
import { provideClientHydration } from "@angular/platform-browser"; | ||
import { provideHttpClient, withFetch } from "@angular/common/http"; | ||
|
||
export const appConfig: ApplicationConfig = { | ||
providers: [ | ||
provideZoneChangeDetection({ eventCoalescing: true }), | ||
provideRouter(routes), | ||
provideHttpClient(withFetch()), | ||
provideClientHydration(), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,60 @@ | ||
import { test as baseTest, expect } from '@playwright/test'; | ||
import { locatorFixtures as fixtures } from '@playwright-testing-library/test/fixture.js'; | ||
import type { LocatorFixtures as TestingLibraryFixtures } from '@playwright-testing-library/test/fixture.js'; | ||
|
||
const test = baseTest.extend<TestingLibraryFixtures>(fixtures) | ||
|
||
test('resource edit', async ({ page, within, queries: { getAllByRole, getByLabelText, getByRole, getByText, queryByRole, queryByText } }) => { | ||
await page.goto('http://localhost:3000/books/'); | ||
|
||
await expect(queryByText('Loading...')).not.toBeVisible(); | ||
|
||
await expect(queryByRole('heading', { level: 1, name: 'Book List' })).toBeVisible(); | ||
|
||
const rows = getAllByRole('row'); | ||
import { test as baseTest, expect } from "@playwright/test"; | ||
import { locatorFixtures as fixtures } from "@playwright-testing-library/test/fixture.js"; | ||
import type { LocatorFixtures as TestingLibraryFixtures } from "@playwright-testing-library/test/fixture.js"; | ||
|
||
const test = baseTest.extend<TestingLibraryFixtures>(fixtures); | ||
|
||
test("resource edit", async ({ | ||
page, | ||
within, | ||
queries: { | ||
getAllByRole, | ||
getByLabelText, | ||
getByRole, | ||
getByText, | ||
queryByRole, | ||
queryByText, | ||
}, | ||
}) => { | ||
await page.goto("http://localhost:3000/books/"); | ||
|
||
await expect(queryByText("Loading...")).not.toBeVisible(); | ||
|
||
await expect( | ||
queryByRole("heading", { level: 1, name: "Book List" }) | ||
).toBeVisible(); | ||
|
||
const rows = getAllByRole("row"); | ||
|
||
const { getAllByRole: getAllByRoleWithinRow } = within(rows.nth(3)); | ||
|
||
const bookLink = getAllByRoleWithinRow('link').nth(0); | ||
const bookLink = getAllByRoleWithinRow("link").nth(0); | ||
bookLink.click(); | ||
|
||
await expect(queryByRole('heading', { level: 1, name: /^\s*Show Book/ })).toBeVisible(); | ||
await expect(queryByText('Loading...')).not.toBeVisible(); | ||
await expect( | ||
queryByRole("heading", { level: 1, name: /^\s*Show Book/ }) | ||
).toBeVisible(); | ||
await expect(queryByText("Loading...")).not.toBeVisible(); | ||
|
||
const editLink = getByRole('link', { name: 'Edit' }); | ||
const editLink = getByRole("link", { name: "Edit" }); | ||
editLink.click(); | ||
|
||
await expect(queryByRole('heading', { level: 1, name: /^\s*Show Book/ })).not.toBeVisible(); | ||
await expect(queryByText('Loading...')).not.toBeVisible(); | ||
await expect( | ||
queryByRole("heading", { level: 1, name: /^\s*Show Book/ }) | ||
).not.toBeVisible(); | ||
await expect(queryByText("Loading...")).not.toBeVisible(); | ||
|
||
await expect(queryByRole('heading', { level: 1 })).toHaveText(/^\s*Edit Book/); | ||
await expect(queryByRole("heading", { level: 1 })).toHaveText( | ||
/^\s*Edit Book/ | ||
); | ||
|
||
await expect(queryByText('Loading...')).not.toBeVisible(); | ||
await expect(queryByText("Loading...")).not.toBeVisible(); | ||
|
||
await expect(getByLabelText('isbn')).toBeEditable(); | ||
await expect(getByLabelText('description')).toBeEditable(); | ||
await expect(getByText('reviews')).toBeVisible(); | ||
await expect(getByLabelText("isbn")).toBeEditable(); | ||
await expect(getByLabelText("description")).toBeEditable(); | ||
await expect(getByText("reviews")).toBeVisible(); | ||
|
||
await expect(getByRole('button', { name: 'Submit' })).toBeVisible(); | ||
await expect(getByRole('button', { name: 'Delete' })).toBeVisible(); | ||
await expect(getByRole('link', { name: /Back to list/ })).toBeVisible(); | ||
await expect(getByRole("button", { name: "Submit" })).toBeVisible(); | ||
await expect(getByRole("button", { name: "Delete" })).toBeVisible(); | ||
await expect(getByRole("link", { name: /Back to list/ })).toBeVisible(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.