Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
V2 Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
SMartorelli committed Jan 28, 2021
1 parent 1dd887e commit 28c25e6
Show file tree
Hide file tree
Showing 222 changed files with 10,670 additions and 8,491 deletions.
37 changes: 2 additions & 35 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Created by https://www.gitignore.io/api/swift,xcode

### Swift ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
Expand Down Expand Up @@ -50,9 +47,6 @@ playground.xcworkspace
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
#
Expand All @@ -72,32 +66,5 @@ fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

### Xcode ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)

### Xcode Patch ###
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcworkspace/contents.xcworkspacedata
/*.gcno
**/xcshareddata/WorkspaceSettings.xcsettings


# End of https://www.gitignore.io/api/swift,xcode
.DS_Store
*.xcuserstate
9 changes: 9 additions & 0 deletions enrollment/.swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
disabled_rules: # rule identifiers to exclude from running
- trailing_whitespace
- line_length
- nesting
- type_body_length
- cyclomatic_complexity
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Carthage
- Pods
8 changes: 5 additions & 3 deletions enrollment/EnrollmentLoginHelper/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSBackgroundOnly</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
Expand All @@ -21,7 +19,11 @@
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>76</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSBackgroundOnly</key>
<true/>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ class LoginHelperAppDelegate: NSObject, NSApplicationDelegate {
}
}
}

1 change: 1 addition & 0 deletions enrollment/EnrollmentLoginHelper/de.lproj/MainMenu.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

12 changes: 0 additions & 12 deletions enrollment/JAMFIntegrationHelper/main.swift

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
//
// BundleInstalationPageTests.swift
// Mac@IBM EnrollmentTests
//
// Created by Jan Valentik on 04/05/2020.
// Copyright © 2020 IBM. All rights reserved.
// SPDX-License-Identifier: GPL-3.0-only
//

import XCTest
@testable import Mac_IBM_Enrollment

class BundleInstallationPageTests: XCTestCase {
let bundleInstallationPageJsonStub = """
{
"title": {
"label": "testLabel",
"alternateLabel": "testAlternateLabel",
"infoSection": {
"fields": [
{
"label": "testLabel",
"description": "testDescription",
"iconName": "testIconName"
}
]
}
},
"subtitle": {
"label": "testLabel",
"alternateLabel": "testAlternateLabel",
"infoSection": {
"fields": [
{
"label": "testLabel",
"description": "testDescription",
"iconName": "testIconName"
}
]
}
},
"bundleInstallationStatus": true,
"bundleInstallationWarning": true
}
"""

func testBundleInstallationPageInitializedCorrectly() throws {
// Given
let decoder = JSONDecoder()
var sut: BundleInstallationPage

// When
sut = try decoder.decode(BundleInstallationPage.self, from: bundleInstallationPageJsonStub.data(using: .utf8)!)

// Then
XCTAssert((sut as Any) is BundleInstallationPage)
XCTAssert((sut.title as Any) is InfoLabel)
XCTAssert((sut.subtitle as Any) is InfoLabel)
}
}
82 changes: 82 additions & 0 deletions enrollment/Mac@IBM EnrollmentTests/BundleSelectionPageTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
//
// BundleSelectionPageTests.swift
// Mac@IBM EnrollmentTests
//
// Created by Jan Valentik on 04/05/2020.
// Copyright © 2020 IBM. All rights reserved.
// SPDX-License-Identifier: GPL-3.0-only
//

import XCTest
@testable import Mac_IBM_Enrollment

class BundleSelectionPageTests: XCTestCase {
let bundleSelectionPageJsonStub = """
{
"title": {
"label": "testLabel",
"alternateLabel": "testAlternateLabel",
"infoSection": {
"fields": [
{
"label": "testLabel",
"description": "testDescription",
"iconName": "testIconName"
}
]
}
},
"subtitle": {
"label": "testLabel",
"alternateLabel": "testAlternateLabel",
"infoSection": {
"fields": [
{
"label": "testLabel",
"description": "testDescription",
"iconName": "testIconName"
}
]
}
},
"bundles": [
{
"title": "testTitle",
"extendedTitle": "testExtendedTitle",
"description": "testDescription",
"key": "testKey",
"icon": "testIcon",
"status": -1,
"warningMessage": "testWarningMessage",
"time": "testTime",
"size": "testSize",
"recommended": true,
"apps": [
{
"title": "appTitle",
"description": "appDescription",
"key": "appKey",
"status": -1,
"icon": "appIcon"
}
]
}
]
}
"""

func testBundleSelectionPageInitializedCorrectly() throws {
// Given
let decoder = JSONDecoder()
var sut: BundleSelectionPage

// When
sut = try decoder.decode(BundleSelectionPage.self, from: bundleSelectionPageJsonStub.data(using: .utf8)!)

// Then
XCTAssert((sut as Any) is BundleSelectionPage)
XCTAssert((sut.title as Any) is InfoLabel)
XCTAssert((sut.subtitle as Any) is InfoLabel)
XCTAssert((sut.bundles as Any) is [EnrollmentBundle])
}
}
50 changes: 50 additions & 0 deletions enrollment/Mac@IBM EnrollmentTests/EnrollmentBundleTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//
// EnrollmentBundleTests.swift
// Mac@IBM EnrollmentTests
//
// Created by Jan Valentik on 04/05/2020.
// Copyright © 2020 IBM. All rights reserved.
// SPDX-License-Identifier: GPL-3.0-only
//

import XCTest
@testable import Mac_IBM_Enrollment

class EnrollmentBundleTests: XCTestCase {
let enrollmentBundleJsonStub = """
{
"title": "testTitle",
"extendedTitle": "testExtendedTitle",
"description": "testDescription",
"key": "testKey",
"icon": "testIcon",
"status": -1,
"warningMessage": "testWarningMessage",
"time": "testTime",
"size": "testSize",
"recommended": true,
"apps": [
{
"title": "appTitle",
"description": "appDescription",
"key": "appKey",
"status": -1,
"icon": "appIcon"
}
]
}
"""

func testEnrollmentBundleInitializedCorrectly() throws {
// Given
let decoder = JSONDecoder()
var sut: EnrollmentBundle

// When
sut = try decoder.decode(EnrollmentBundle.self, from: enrollmentBundleJsonStub.data(using: .utf8)!)

// Then
XCTAssert((sut as Any) is EnrollmentBundle)
XCTAssert((sut.apps as Any) is [EnrollmentBundle.App])
}
}
Loading

0 comments on commit 28c25e6

Please sign in to comment.