/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #import #import "FBElement.h" #import "XCUIElementDouble.h" #import "FBElementUtils.h" @interface FBElementUtilitiesTests : XCTestCase @end @implementation FBElementUtilitiesTests - (void)testTypesFiltering { NSMutableArray *elements = [NSMutableArray new]; XCUIElementDouble *el1 = [XCUIElementDouble new]; [elements addObject:el1]; XCUIElementDouble *el2 = [XCUIElementDouble new]; el2.elementType = XCUIElementTypeAlert; el2.wdType = @"XCUIElementTypeAlert"; [elements addObject:el2]; XCUIElementDouble *el3 = [XCUIElementDouble new]; [elements addObject:el3]; NSSet *result = [FBElementUtils uniqueElementTypesWithElements:elements]; XCTAssertEqual([result count], 2); } @end