hopefully fix issue where voting is filled in with missing when its time to vote
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
//
|
||||
|
||||
import XCTest
|
||||
@testable import iFeel
|
||||
|
||||
class Tests_iOS: XCTestCase {
|
||||
|
||||
override func setUpWithError() throws {
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
|
||||
@@ -22,21 +22,36 @@ class Tests_iOS: XCTestCase {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
func testExample() throws {
|
||||
// UI tests must launch the application that they test.
|
||||
let app = XCUIApplication()
|
||||
app.launch()
|
||||
|
||||
// Use recording to get started writing UI tests.
|
||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
||||
func testDatesBetween() {
|
||||
let today = Calendar.current.date(bySettingHour: 0, minute: 0, second: 0, of: Date())!
|
||||
let yesterday = Calendar.current.date(byAdding: .day, value: -1, to: today)!
|
||||
let tenDaysAgo = Calendar.current.date(byAdding: .day, value: -10, to: today)!
|
||||
|
||||
let dates = Date.dates(from: Calendar.current.date(byAdding: .day, value: -10, to: Date())!, toDate: Date())
|
||||
|
||||
XCTAssertTrue(dates.last == yesterday)
|
||||
XCTAssertTrue(dates.first == tenDaysAgo)
|
||||
}
|
||||
|
||||
func testDatesIncluding() {
|
||||
let today = Calendar.current.date(bySettingHour: 0, minute: 0, second: 0, of: Date())!
|
||||
let yesterday = Calendar.current.date(bySettingHour: 0, minute: 0, second: 0, of: Date())!
|
||||
let tenDaysAgo = Calendar.current.date(byAdding: .day, value: -10, to: today)!
|
||||
|
||||
func testLaunchPerformance() throws {
|
||||
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
|
||||
// This measures how long it takes to launch your application.
|
||||
measure(metrics: [XCTApplicationLaunchMetric()]) {
|
||||
XCUIApplication().launch()
|
||||
}
|
||||
}
|
||||
let dates = Date.dates(from: Calendar.current.date(byAdding: .day, value: -10, to: Date())!, toDate: Date(), includingToDate: true)
|
||||
|
||||
XCTAssertTrue(dates.last == today)
|
||||
XCTAssertTrue(dates.first == tenDaysAgo)
|
||||
}
|
||||
|
||||
// func testLastVoteShouldExist() {
|
||||
// let todayOneHourAhead = Calendar.current.date(byAdding: .day, value: 1, to: Date())!
|
||||
// let fakeOnboarding = OnboardingData()
|
||||
// fakeOnboarding.inputDay = DayOptions.Today
|
||||
// fakeOnboarding.date = todayOneHourAhead
|
||||
//
|
||||
// let lastDay = ShowBasedOnVoteLogics.getLastDateVoteShouldExist(onboardingData: fakeOnboarding)
|
||||
// let yesterday = Calendar.current.date(byAdding: .day, value: -1, to: Date())!
|
||||
// XCTAssertTrue(lastDay == yesterday)
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class Tests_iOSLaunchTests: XCTestCase {
|
||||
continueAfterFailure = false
|
||||
}
|
||||
|
||||
func testLaunch() throws {
|
||||
func _testLaunch() throws {
|
||||
let app = XCUIApplication()
|
||||
app.launch()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user