(controlToTest: T, testFunction: (views: [T, Page]) => void, options?: PageOptions)
| 72 | } |
| 73 | |
| 74 | export function buildUIAndRunTest<T extends View>(controlToTest: T, testFunction: (views: [T, Page]) => void, options?: PageOptions) { |
| 75 | clearPage(); |
| 76 | let newPage = getCurrentPage(); |
| 77 | |
| 78 | let testSubject = controlToTest as View; |
| 79 | |
| 80 | if (options) { |
| 81 | if (options.pageCss) { |
| 82 | newPage.css = options.pageCss; |
| 83 | } |
| 84 | |
| 85 | newPage.actionBarHidden = true; |
| 86 | newPage.actionBar.flat = false; |
| 87 | |
| 88 | if (options.actionBar) { |
| 89 | newPage.actionBarHidden = false; |
| 90 | newPage.actionBar.title = 'Test ActionBar'; |
| 91 | } |
| 92 | |
| 93 | if (options.actionBarFlat) { |
| 94 | newPage.actionBarHidden = false; |
| 95 | newPage.actionBar.title = 'Test ActionBar Flat'; |
| 96 | newPage.actionBar.flat = true; |
| 97 | } |
| 98 | |
| 99 | if (options.actionBarHidden) { |
| 100 | newPage.actionBarHidden = true; |
| 101 | } |
| 102 | |
| 103 | if (options.tabBar) { |
| 104 | const tabView = new TabView(); |
| 105 | const tabEntry = new TabViewItem(); |
| 106 | tabEntry.title = 'Test'; |
| 107 | tabEntry.view = controlToTest; |
| 108 | tabView.items = [tabEntry]; |
| 109 | testSubject = tabView; |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | newPage.content = testSubject; |
| 114 | |
| 115 | testFunction([controlToTest, newPage]); |
| 116 | newPage.content = null; |
| 117 | newPage.css = null; |
| 118 | } |
| 119 | |
| 120 | export function buildUIWithWeakRefAndInteract<T extends View>(createFunc: () => T, interactWithViewFunc?: (view: T) => void, done?) { |
| 121 | clearPage(); |
no test coverage detected