Skip to content

Commit 9892f4b

Browse files
committed
fixed problems in CommitBox.spec.tsx
should probably come up with a better way of mocking settings
1 parent 5307d77 commit 9892f4b

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

tests/test-components/CommitBox.spec.tsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ describe('CommitBox', () => {
1212
it('should update commit box state to be ready when changes are staged', () => {
1313
const box = new CommitBox({
1414
commitFunc: async () => {},
15-
hasFiles: true
15+
hasFiles: true,
16+
settings: { composite: {} } as any
1617
});
1718

1819
let actual = box.commitButtonStyle(true);
@@ -27,7 +28,8 @@ describe('CommitBox', () => {
2728
it('should update commit box state to be disabled when no changes are staged', () => {
2829
const box = new CommitBox({
2930
commitFunc: async () => {},
30-
hasFiles: true
31+
hasFiles: true,
32+
settings: { composite: {} } as any
3133
});
3234

3335
let actual = box.commitButtonStyle(false);
@@ -41,19 +43,14 @@ describe('CommitBox', () => {
4143
it('should be ready to commit with a message set.', () => {
4244
const box = new CommitBox({
4345
commitFunc: async () => {},
44-
hasFiles: true
46+
hasFiles: true,
47+
settings: { composite: {} } as any
4548
});
46-
box.setState(
47-
{
48-
value: 'message'
49-
},
50-
() => {
51-
let actual = box.commitButtonStyle(true);
49+
box.state = { value: 'message' };
5250

53-
let expected = stagedCommitButtonStyle;
54-
expect(actual).toEqual(expected);
55-
}
56-
);
51+
let actual = box.commitButtonStyle(true);
52+
let expected = stagedCommitButtonStyle;
53+
expect(actual).toEqual(expected);
5754
});
5855
});
5956
});

0 commit comments

Comments
 (0)