Add Flipper plugin for Navigation
Summary: The main goal is to update visitation id for our targeted tabs requirements (https://fb.quip.com/2jZiA97DTATi). In doing so, we want an easier way to debug whether everything is working as expected. I've been meaning to add something like this for a while since it's a pain to explain what the visitation id and HSM look like as you navigate the app, so this should help the other teams who're using visitation id as well. Will probably also start adding navigation events and any other data that we feel is useful. Run: ``` fbsource/xplat/sonar/scripts/facebook/create-plugin.py Navigation --android ``` Then clean a few things up and fix lints. Differential Revision: D14759995 fbshipit-source-id: 066dcbf70eed7056f995053cc9ba80dcbbafdb03
This commit is contained in:
committed by
Facebook Github Bot
parent
821232a9c6
commit
2badd4efea
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) 2018-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the LICENSE
|
||||
* file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
package com.facebook.flipper.plugins.navigation;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.hasItem;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
import com.facebook.flipper.core.FlipperObject;
|
||||
import com.facebook.flipper.testing.FlipperConnectionMock;
|
||||
import com.facebook.flipper.testing.FlipperResponderMock;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class NavigationFlipperPluginTest {
|
||||
|
||||
@Test
|
||||
public void greetingTest() throws Exception {
|
||||
final NavigationFlipperPlugin plugin = new NavigationFlipperPlugin();
|
||||
final FlipperConnectionMock connection = new FlipperConnectionMock();
|
||||
final FlipperResponderMock responder = new FlipperResponderMock();
|
||||
|
||||
plugin.onConnect(connection);
|
||||
connection.receivers.get("greet").onReceive(null, responder);
|
||||
|
||||
assertThat(
|
||||
responder.successes, hasItem(new FlipperObject.Builder().put("greeting", "Hello").build()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user