@Test
	public void testPasteActionEnabled2() throws Exception {
		showSymbolTree();
		// cut label from Global
		// select a function; paste should be enabled because it's address is within the function

		SymbolTable symTable = program.getSymbolTable();
		// create label within body of ghidra function
		int transactionID = program.startTransaction("test");
		symTable.createLabel(util.addr(0x01002d04), "fred", SourceType.USER_DEFINED);
		program.endTransaction(transactionID, true);

		flushAndWaitForTree();

		// Functions node
		GTreeNode fNode = rootNode.getChild(2);
		util.expandNode(fNode);

		GTreeNode labelsNode = rootNode.getChild("Labels");
		GTreeNode namespaceNode = rootNode.getChild("Namespaces");
		util.selectNode(namespaceNode);
		performAction(createNamespaceAction, util.getSymbolTreeContext(), true);
		util.waitForTree();
		runSwing(() -> tree.stopEditing());
		GTreeNode fredNode = labelsNode.getChild("fred");
		util.selectNode(fredNode);

		waitForSwing();
		assertTrue(cutAction.isEnabledForContext(util.getSymbolTreeContext()));
		performAction(cutAction, util.getSymbolTreeContext(), true);

		// NewNamespace node
		GTreeNode gNode = namespaceNode.getChild(0);
		util.selectNode(gNode);
		assertTrue(pasteAction.isEnabledForContext(util.getSymbolTreeContext()));

		// doStuff function node
		waitForSwing();
		GTreeNode dNode = fNode.getChild(0);
		util.selectNode(dNode);
		assertFalse(pasteAction.isEnabledForContext(util.getSymbolTreeContext()));
	}
Tests for the symbol tree plugin.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/symboltree/SymbolTreePlugin1Test.java