Skip to content

Commit

Permalink
Cleanup from rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyfroehlich committed Sep 13, 2023
1 parent b8fc469 commit d32edc9
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 113 deletions.
14 changes: 4 additions & 10 deletions integration-tests/validation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ plugins {

var applicationID = "com.android.designcompose.testapp.validation"

@Suppress("UnstableApiUsage")
android {
namespace = applicationID
compileSdk = libs.versions.compileSdk.get().toInt()
Expand All @@ -38,10 +39,6 @@ android {
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
if (designcompose.figmaToken.isPresent) {
testInstrumentationRunnerArguments["FIGMA_ACCESS_TOKEN"] =
designcompose.figmaToken.get()
}
vectorDrawables.useSupportLibrary = true
}

Expand Down Expand Up @@ -74,7 +71,7 @@ android {
kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get()
}

packaging { resources { excludes.add("/META-INF/{AL2.0,LGPL2.1}") } }
packaging { resources { excludes.add("/META-INF/*") } }
}

dependencies {
Expand All @@ -92,13 +89,10 @@ dependencies {

debugImplementation(libs.androidx.compose.ui.tooling)
debugImplementation(libs.androidx.compose.ui.test.manifest)

androidTestImplementation(testFixtures(project(":designcompose")))
androidTestImplementation(kotlin("test"))
androidTestImplementation(libs.junit)
androidTestImplementation(libs.google.truth)
androidTestImplementation(libs.androidx.compose.ui.tooling)
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
androidTestImplementation(libs.androidx.test.espresso.core)
androidTestImplementation(libs.mockk.android)
androidTestImplementation(libs.mockk.agent)
androidTestImplementation(libs.androidx.rules)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.android.designcompose.testapp.validation

import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithText
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.android.designcompose.DesignSettings
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class BasicRenderingTests {
@get:Rule val composeTestRule = createComposeRule()

@Before
fun setUp() {
DesignSettings.addFontFamily("Inter", interFont)
}

@Test
fun testHello() {
composeTestRule.setContent { HelloWorld() }
composeTestRule.onNodeWithText("World", substring = true).assertExists()
}

@Test
fun testTelltale() {
composeTestRule.setContent { TelltaleTest() }
composeTestRule.onNodeWithText("Frames").assertExists()
}

@Test
fun renderDialsGauges() {
composeTestRule.setContent { DialsGaugesTest() }
composeTestRule.onNodeWithText("Rotation Test", substring = true).assertExists()
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -114,44 +114,40 @@ val interFont =

const val TAG = "DesignCompose"

val EXAMPLES: ArrayList<Triple<String, @Composable () -> Unit, String?>> =
val EXAMPLES: ArrayList<Pair<String, @Composable () -> Unit>> =
arrayListOf(
Triple("Hello", { HelloWorld() }, "pxVlixodJqZL95zo2RzTHl"),
Triple("Image Update", { ImageUpdateTest() }, "oQw7kiy94fvdVouCYBC9T0"),
Triple("Telltales", { TelltaleTest() }, "TZgHrKWx8wvQM7UPTyEpmz"),
Triple("OpenLink", { OpenLinkTest() }, "r7m4tqyKv6y9DWcg7QBEDf"),
Triple("Variant *", { VariantAsteriskTest() }, "gQeYHGCSaBE4zYSFpBrhre"),
Triple("Alignment", { AlignmentTest() }, "JIjE9oKQbq8ipi66ab5UaK"),
Triple("Battleship", { BattleshipTest() }, "RfGl9SWnBEvdg8T1Ex6ZAR"),
Triple("H Constraints", { HConstraintsTest() }, "KuHLbsKA23DjZPhhgHqt71"),
Triple("V Constraints", { VConstraintsTest() }, "KuHLbsKA23DjZPhhgHqt71"),
Triple("Interaction", { InteractionTest() }, "8Zg9viyjYTnyN29pbkR1CE"),
Triple("Shadows", { ShadowsTest() }, "OqK58Y46IqP4wIgKCWys48"),
Triple("Item Spacing", { ItemSpacingTest() }, "YXrHBp6C6OaW5ShcCYeGJc"),
Triple("Recurse Customization", { RecursiveCustomizations() }, "o0GWzcqdOWEgzj4kIeIlAu"),
Triple("Color Tint", { ColorTintTest() }, "MCtUD3yjONxK6rQm65yqM5"),
Triple("Variant Properties", { VariantPropertiesTest() }, "4P7zDdrQxj7FZsKJoIQcx1"),
Triple("Lazy Grid", { LazyGridItemSpans() }, null),
Triple("Grid Layout", { GridLayoutTest() }, "JOSOEvsrjvMqanyQa5OpNR"),
Triple("Grid Widget", { GridWidgetTest() }, "OBhNItd9i9J2LwVYuLxEIx"),
Triple("List Widget", { ListWidgetTest() }, "9ev0MBNHFrgTqJOrAGcEpV"),
Triple("1px Separator", { OnePxSeparatorTest() }, "EXjTHxfMNBtXDrz8hr6MFB"),
Triple("Variant Interactions", { VariantInteractionsTest() }, "WcsgoLR4aDRSkZHY29Qdhq"),
Triple("Layout Replacement", { LayoutReplacementTest() }, "dwk2GF7RiNvlbbAKPjqldx"),
Triple("Text Elide", { TextElideTest() }, "oQ7nK49Ya5PJ3GpjI5iy8d"),
Triple("Fancy Fills", { FancyFillTest() }, "xQ9cunHt8VUm6xqJJ2Pjb2"),
Triple("Fill Container", { FillTest() }, "dB3q96FkxkTO4czn5NqnxV"),
Triple("CrossAxis Fill", { CrossAxisFillTest() }, "GPr1cx4n3zBPwLhqlSL1ba"),
Triple(
"Grid Layout Documentation",
{ GridLayoutDocumentation() },
"MBNjjSbzzKeN7nBjVoewsl"
),
Triple("Blend Modes", { BlendModeTest() }, "ZqX5i5g6inv9tANIwMMXUV"),
Triple("Vector Rendering", { VectorRenderingTest() }, "Z3ucY0wMAbIwZIa6mLEWIK"),
Triple("Dials Gauges", { DialsGaugesTest() }, "lZj6E9GtIQQE4HNLpzgETw"),
Triple("Masks", { MaskTest() }, "mEmdUVEIjvBBbV0kELPy37"),
Triple("Variable Borders", { VariableBorderTest() }, "MWnVAfW3FupV4VMLNR1m67")
Pair("Hello", { HelloWorld() }),
Pair("Image Update", { ImageUpdateTest() }),
Pair("Telltales", { TelltaleTest() }),
Pair("OpenLink", { OpenLinkTest() }),
Pair("Variant *", { VariantAsteriskTest() }),
Pair("Alignment", { AlignmentTest() }),
Pair("Battleship", { BattleshipTest() }),
Pair("H Constraints", { HConstraintsTest() }),
Pair("V Constraints", { VConstraintsTest() }),
Pair("Interaction", { InteractionTest() }),
Pair("Shadows", { ShadowsTest() }),
Pair("Recurse Customization", { RecursiveCustomizations() }),
Pair("Item Spacing", { ItemSpacingTest() }),
Pair("Color Tint", { ColorTintTest() }),
Pair("Variant Properties", { VariantPropertiesTest() }),
Pair("Lazy Grid", { LazyGridItemSpans() }),
Pair("Grid Layout", { GridLayoutTest() }),
Pair("Grid Widget", { GridWidgetTest() }),
Pair("List Widget", { ListWidgetTest() }),
Pair("Variant Interactions", { VariantInteractionsTest() }),
Pair("1px Separator", { OnePxSeparatorTest() }),
Pair("Layout Replacement", { LayoutReplacementTest() }),
Pair("Text Elide", { TextElideTest() }),
Pair("Fancy Fills", { FancyFillTest() }),
Pair("Fill Container", { FillTest() }),
Pair("CrossAxis Fill", { CrossAxisFillTest() }),
Pair("Grid Layout Documentation", { GridLayoutDocumentation() }),
Pair("Blend Modes", { BlendModeTest() }),
Pair("Vector Rendering", { VectorRenderingTest() }),
Pair("Dials Gauges", { DialsGaugesTest() }),
Pair("Masks", { MaskTest() }),
Pair("Variable Borders", { VariableBorderTest() })
)

// TEST Basic Hello World example
Expand Down

0 comments on commit d32edc9

Please sign in to comment.