-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(springwolf-ui): re-add smoke-test for complete app
Co-authored-by: Timon Back <timonback@users.noreply.github.com>
- Loading branch information
Showing
4 changed files
with
57 additions
and
10 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -11,6 +11,6 @@ main { | |
padding: 0; | ||
} | ||
|
||
section { | ||
article { | ||
margin: 2em 1em; | ||
} |
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,47 @@ | ||
/* SPDX-License-Identifier: Apache-2.0 */ | ||
import { AppComponent } from "./app.component"; | ||
import { render, screen, waitFor, within } from "@testing-library/angular"; | ||
import { appConfig } from "./app.config"; | ||
import { MatIconTestingModule } from "@angular/material/icon/testing"; | ||
|
||
describe("AppComponent", () => { | ||
test("should render", async () => { | ||
await render(AppComponent, { | ||
providers: appConfig.providers, | ||
imports: [MatIconTestingModule], | ||
}); | ||
|
||
await waitFor(() => { | ||
expect( | ||
screen.getAllByText("Springwolf example project", { exact: false }) | ||
.length | ||
).toBeGreaterThan(0); | ||
}); | ||
|
||
// get menu items | ||
const articles = screen.getAllByRole("article"); | ||
|
||
// server menu | ||
const servers = articles.find( | ||
(article) => within(article).queryByText("Servers") !== null | ||
); | ||
expect(servers).not.toBeNull(); | ||
expect(within(servers!!).getAllByRole("article").length).toBeGreaterThan(0); | ||
|
||
// channel menu | ||
const channels = articles.find( | ||
(article) => within(article).queryByText("Channels") !== null | ||
); | ||
expect(channels).not.toBeNull(); | ||
expect(within(channels!!).getAllByRole("article").length).toBeGreaterThan( | ||
0 | ||
); | ||
|
||
// schema menu | ||
const schemas = articles.find( | ||
(article) => within(article).queryByText("Schemas") !== null | ||
); | ||
expect(schemas).not.toBeNull(); | ||
expect(within(schemas!!).getAllByRole("article").length).toBeGreaterThan(0); | ||
}); | ||
}); |