-
Notifications
You must be signed in to change notification settings - Fork 197
Expand file tree
/
Copy pathKVNProgressTests.m
More file actions
72 lines (56 loc) · 1.79 KB
/
KVNProgressTests.m
File metadata and controls
72 lines (56 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//
// KVNProgressTests.m
// KVNProgressTests
//
// Created by Kevin Hirsch on 24/05/14.
// Copyright (c) 2014 Kevin Hirsch. All rights reserved.
//
#import <Specta/Specta.h>
#import <Expecta/Expecta.h>
#import <FBSnapshotTestCase/FBSnapshotTestCase.h>
#import "KVNProgress.h"
SpecBegin(KVNProgress)
describe(@"appearance", ^{
beforeEach(^{
waitUntil(^(DoneCallback done) {
if ([KVNProgress isVisible]) {
[KVNProgress dismissWithCompletion:^{
done();
}];
} else {
done();
}
});
});
it(@"shows the basic progress view", ^{
[KVNProgress show];
expect([KVNProgress isVisible]).after(1).to.beTruthy();
});
it(@"shows then hides the basic progress view", ^{
[KVNProgress show];
expect([KVNProgress isVisible]).after(1).to.beTruthy();
[KVNProgress dismiss];
expect([KVNProgress isVisible]).after(1).to.beFalsy();
});
it(@"shows progress and status", ^{
// TODO
// [KVNProgress showProgress:0.50 status:@"Testing"];
// UIView *v = [[UIApplication sharedApplication] keyWindow];
// expect(v).after(3).to.recordSnapshot();
// expect(v).after(3).to.haveValidSnapshot();
});
});
describe(@"notifications", ^{
it(@"calls the tap handler when the KVNProgress is tapped", ^{
[KVNProgress setConfiguration:[KVNProgressConfiguration defaultConfiguration]];
KVNProgressConfiguration *configuration = [KVNProgressConfiguration defaultConfiguration];
configuration.tapBlock = ^(KVNProgress *progressView) {
// TODO
};
[KVNProgress show];
});
});
describe(@"can be customised via KVNProgressConfiguration", ^{
// TODO
});
SpecEnd