Skip to content

Commit

Permalink
rename example object
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoschenkel committed May 14, 2022
1 parent fd44039 commit 0fa3e11
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { Container, Sprite, Text } from "pixi.js";
import { MediatorMap } from "../../../../../../src/robotlegs/bender/extensions/mediatorMap/impl/MediatorMap";
import "../../../../../entry";
import { Alpha50PercentHook } from "../support/Alpha50PercentHook";
import { ExampleDisplayObjectMediator } from "../support/ExampleDisplayObjectMediator";
import { ExampleMediator } from "../support/ExampleMediator";
import { ExampleMediator2 } from "../support/ExampleMediator2";
import { ExampleSpriteMediator } from "../support/ExampleSpriteMediator";
import { HappyGuard } from "../support/HappyGuard";
import { HookWithMediatorAndViewInjectionReportFunction } from "../support/HookWithMediatorAndViewInjectionReportFunction";
import { MediatorWatcher } from "../support/MediatorWatcher";
Expand Down Expand Up @@ -108,19 +108,17 @@ describe("MediatorMap", () => {
it("handler_creates_mediator_for_view_mapped_by_matcher", () => {
mediatorMap
.mapMatcher(new TypeMatcher().allOf(Container))
.toMediator(ExampleDisplayObjectMediator);
.toMediator(ExampleSpriteMediator);

mediatorMap.handleView(new Sprite(), Sprite);

const expectedNotifications: string[] = ["ExampleDisplayObjectMediator"];
const expectedNotifications: string[] = ["ExampleSpriteMediator"];

assert.deepEqual(expectedNotifications, mediatorWatcher.notifications);
});

it("handler_doesnt_create_mediator_for_wrong_view_mapped_by_matcher", () => {
mediatorMap
.mapMatcher(new TypeMatcher().allOf(Text))
.toMediator(ExampleDisplayObjectMediator);
mediatorMap.mapMatcher(new TypeMatcher().allOf(Text)).toMediator(ExampleSpriteMediator);

mediatorMap.handleView(new Sprite(), Sprite);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import { Sprite } from "pixi.js";
import { MediatorWatcher } from "./MediatorWatcher";

@injectable()
export class ExampleDisplayObjectMediator {
export class ExampleSpriteMediator {
@inject(MediatorWatcher)
public mediatorWatcher: MediatorWatcher;

@inject(Sprite)
public view: Sprite;

public initialize(): void {
this.mediatorWatcher.notify("ExampleDisplayObjectMediator");
this.mediatorWatcher.notify("ExampleSpriteMediator");
}
}

0 comments on commit 0fa3e11

Please sign in to comment.