-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/ProjektAdLer/2D_3D_AdLer
- Loading branch information
Showing
11 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+695 KB
src/Assets/misc/quizBackgrounds/a_npc_bully/a_npc_bully_disappointed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
58 changes: 58 additions & 0 deletions
58
...rEditor/AvatarEditorPreview/AvatarEditorPreviewModel/AvatarEditorPreviewModelView.test.ts
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,58 @@ | ||
import { mockDeep } from "jest-mock-extended"; | ||
import CoreDIContainer from "../../../../../Core/DependencyInjection/CoreDIContainer"; | ||
import SCENE_TYPES from "../../../../../Core/DependencyInjection/Scenes/SCENE_TYPES"; | ||
import AvatarEditorPreviewModelView from "../../../../../Core/Presentation/AvatarEditor/AvatarEditorPreview/AvatarEditorPreviewModel/AvatarEditorPreviewModelView"; | ||
import AvatarEditorPreviewModelViewModel from "../../../../../Core/Presentation/AvatarEditor/AvatarEditorPreview/AvatarEditorPreviewModel/AvatarEditorPreviewModelViewModel"; | ||
import IScenePresenter from "../../../../../Core/Presentation/Babylon/SceneManagement/IScenePresenter"; | ||
import { AbstractMesh, NullEngine, Scene } from "@babylonjs/core"; | ||
|
||
const scenePresenterMock = mockDeep<IScenePresenter>(); | ||
const scenePresenterFactoryMock = () => scenePresenterMock; | ||
function buildSystemUnderTest(): [ | ||
AvatarEditorPreviewModelViewModel, | ||
AvatarEditorPreviewModelView, | ||
] { | ||
const viewModel = new AvatarEditorPreviewModelViewModel(); | ||
const systemUnderTest = new AvatarEditorPreviewModelView(viewModel); | ||
return [viewModel, systemUnderTest]; | ||
} | ||
|
||
describe("AvatarEditorPreviewModelView", () => { | ||
let systemUnderTest: AvatarEditorPreviewModelView; | ||
|
||
beforeAll(() => { | ||
CoreDIContainer.snapshot(); | ||
CoreDIContainer.rebind(SCENE_TYPES.ScenePresenterFactory).toConstantValue( | ||
scenePresenterFactoryMock, | ||
); | ||
}); | ||
beforeEach(() => { | ||
buildSystemUnderTest(); | ||
}); | ||
|
||
afterAll(() => { | ||
CoreDIContainer.restore(); | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
test("constructor injects scenePresenter", async () => { | ||
scenePresenterMock.loadModel.mockResolvedValue([ | ||
new AbstractMesh("TestMesh", new Scene(new NullEngine())), | ||
]); | ||
|
||
const [, systemUnderTest] = buildSystemUnderTest(); | ||
expect(systemUnderTest["scenePresenter"]).toBeDefined(); | ||
}); | ||
|
||
test("constructor subscribes to viewModel.isOpen", () => { | ||
scenePresenterMock.loadModel.mockResolvedValue([ | ||
new AbstractMesh("TestMesh", new Scene(new NullEngine())), | ||
]); | ||
|
||
const [viewModel, systemUnderTest] = buildSystemUnderTest(); | ||
|
||
expect(viewModel.avatarConfigDiff["subscribers"]).toStrictEqual([ | ||
systemUnderTest["onAvatarConfigChanged"], | ||
]); | ||
}); | ||
}); |