Skip to content

Commit

Permalink
fix: add snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
wtho committed Jun 30, 2019
1 parent a383dd8 commit 5c49459
Showing 1 changed file with 60 additions and 3 deletions.
63 changes: 60 additions & 3 deletions example/src/app/inline/inline.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,71 @@ describe("Jest Snapshot Bug", () => {
});

it("should allow snapshots", () => {
expect(fixture).toMatchInlineSnapshot();
expect(fixture).toMatchInlineSnapshot(`
<tc-jest-inline-test1
condition1={[Function Boolean]}
condition2="false"
value1={[Function String]}
value2={[Function String]}
>
<div>
Line 1
</div><div>
<div>
val1
</div>
</div>
</tc-jest-inline-test1>
`);

comp.condition2 = true;
fixture.detectChanges();
expect(fixture).toMatchInlineSnapshot();
expect(fixture).toMatchInlineSnapshot(`
<tc-jest-inline-test1
condition1={[Function Boolean]}
condition2={[Function Boolean]}
value1={[Function String]}
value2={[Function String]}
>
<div>
Line 1
</div><div>
<div>
val1
</div>
<span>
val2
</span>
</div>
</tc-jest-inline-test1>
`);

comp.condition1 = false;
comp.condition2 = false;
expect(fixture).toMatchInlineSnapshot();
expect(fixture).toMatchInlineSnapshot(`
<tc-jest-inline-test1
condition1="false"
condition2="false"
value1={[Function String]}
value2={[Function String]}
>
<div>
Line 1
</div><div>
<div>
val1
</div>
<span>
val2
</span>
</div>
</tc-jest-inline-test1>
`);
});
});

0 comments on commit 5c49459

Please sign in to comment.