Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lolopinto committed Feb 6, 2024
1 parent d831913 commit 8f1f481
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion examples/simple/src/ent/mixins/feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export function isFeedback(ent: unknown): ent is IFeedback {
}

export function FeedbackMixin<T extends Constructor>(BaseClass: T) {
// THIS DOESN'T WORK BECAUSE DOESN'T HAVE IFeedbackBase methods
return class FeedbackMixin
extends FeedbackBaseMixin(BaseClass)
implements IFeedback
Expand Down
6 changes: 4 additions & 2 deletions examples/simple/src/ent/tests/mixin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,19 @@ async function createEvent(
test("feedback user", async () => {
const user = await createUser();
expect(isFeedback(user)).toBe(true);
expect(await user.hasLikers()).toBe(true);
expect(await user.hasLikers()).toBe(false);
});

test("feedback contact", async () => {
const user = await createUser();
const contact = await createContact(user, "Jon", "Snow");
expect(isFeedback(contact)).toBe(true);
expect(await user.hasLikers()).toBe(true);
expect(await user.hasLikers()).toBe(false);
});

test("feedback event", async () => {
const event = await createEvent(new Date());
expect(isFeedback(event)).toBe(false);
// can't call hasLikers on event
// expect(await event.hasLikers()).toBe(false);
});
2 changes: 1 addition & 1 deletion internal/tscode/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ func writeMixinFile(processor *codegen.Processor, pattern *schema.PatternInfo) e
PathToFile: filePath,
TsImports: imps,
FuncMap: getBaseFuncs(processor.Schema, imps),
})
}, file.WriteOnce())
}

func writeMixinBaseFile(processor *codegen.Processor, pattern *schema.PatternInfo) error {
Expand Down

0 comments on commit 8f1f481

Please sign in to comment.