summaryrefslogtreecommitdiff
path: root/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenViewControllerSnapshotTests.m
blob: 341e10105357860b053bb4f31fa016ca234ee2ea (plain)
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
73
74
75
76
77
78
79
80
//
//  SDLLockScreenViewControllerSnapshotTests.m
//  SmartDeviceLink-iOS
//
//  Created by Joel Fischer on 7/27/16.
//  Copyright © 2016 smartdevicelink. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <FBSnapshotTestCase/FBSnapshotTestCase.h>

#import "SDLLockScreenConfiguration.h"
#import "SDLLockScreenViewController.h"


@interface SDLLockScreenViewControllerSnapshotTests : FBSnapshotTestCase

@property (strong, nonatomic) SDLLockScreenViewController *lockScreenViewController;

@end


@implementation SDLLockScreenViewControllerSnapshotTests

- (void)setUp {
    [super setUp];
    
    self.lockScreenViewController = [[UIStoryboard storyboardWithName:@"SDLLockScreen" bundle:[NSBundle bundleForClass:[self class]]] instantiateInitialViewController];
    self.lockScreenViewController.view.frame = [[UIScreen mainScreen] bounds];
    
//    self.deviceAgnostic = YES;
//    self.recordMode = YES;
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testNoAppNoVehicleIcons {
    self.lockScreenViewController.appIcon = nil;
    self.lockScreenViewController.vehicleIcon = nil;
    self.lockScreenViewController.backgroundColor = [SDLLockScreenConfiguration enabledConfiguration].backgroundColor;
    
    FBSnapshotVerifyView(self.lockScreenViewController.view, nil);
}

- (void)testOnlyAppIcon {
    self.lockScreenViewController.appIcon = [UIImage imageNamed:@"TestLockScreenAppIcon" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil];
    self.lockScreenViewController.vehicleIcon = nil;
    self.lockScreenViewController.backgroundColor = [SDLLockScreenConfiguration enabledConfiguration].backgroundColor;
    
    FBSnapshotVerifyView(self.lockScreenViewController.view, nil);
}

- (void)testOnlyVehicleIcon {
    self.lockScreenViewController.appIcon = nil;
    self.lockScreenViewController.vehicleIcon = [UIImage imageNamed:@"testImagePNG" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil];
    self.lockScreenViewController.backgroundColor = [SDLLockScreenConfiguration enabledConfiguration].backgroundColor;
    
    FBSnapshotVerifyView(self.lockScreenViewController.view, nil);
}

- (void)testAppAndVehicleIcons {
    self.lockScreenViewController.appIcon = [UIImage imageNamed:@"TestLockScreenAppIcon" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil];;
    self.lockScreenViewController.vehicleIcon = [UIImage imageNamed:@"testImagePNG" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil];
    self.lockScreenViewController.backgroundColor = [SDLLockScreenConfiguration enabledConfiguration].backgroundColor;
    
    FBSnapshotVerifyView(self.lockScreenViewController.view, nil);
}

- (void)testLightBackgroundNoAppNoVehicleIcons {
    self.lockScreenViewController.appIcon = nil;
    self.lockScreenViewController.vehicleIcon = nil;
    self.lockScreenViewController.backgroundColor = [UIColor whiteColor];
    
    FBSnapshotVerifyView(self.lockScreenViewController.view, nil);
}

@end