mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-28 16:19:58 +02:00
RipButtonHandlerTest.java - clean up imports and fix linter warnings
This commit is contained in:
@@ -1,18 +1,15 @@
|
||||
package com.rarchives.ripme.ui;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class RipButtonHandlerTest {
|
||||
|
||||
|
||||
@Test
|
||||
@Tag("flaky")
|
||||
public void duplicateUrlTestCase() throws IOException {
|
||||
@@ -21,17 +18,17 @@ public class RipButtonHandlerTest {
|
||||
SwingUtilities.invokeLater(testMainWindow);
|
||||
|
||||
MainWindow.RipButtonHandler rbHandler = new MainWindow.RipButtonHandler(testMainWindow);
|
||||
// Creating a RipButtonHandler instance - Changing fake text to cause github to rebuild 1.
|
||||
// Creating a RipButtonHandler instance - Changing fake text to cause github to
|
||||
// rebuild 1.
|
||||
|
||||
// Add some URL to the model (assuming there's a method for adding URLs)
|
||||
testMainWindow.getRipTextfield().setText("http://example.com");
|
||||
MainWindow.getRipTextfield().setText("http://example.com");
|
||||
rbHandler.actionPerformed(null);
|
||||
testMainWindow.getRipTextfield().setText("http://example.com");
|
||||
MainWindow.getRipTextfield().setText("http://example.com");
|
||||
rbHandler.actionPerformed(null);
|
||||
|
||||
// Assuming your MainWindow or RipButtonHandler sets some flag or state
|
||||
// indicating that a duplicate URL was encountered
|
||||
assertEquals(testMainWindow.getRipTextfield().getText(), "");
|
||||
assertEquals(MainWindow.getRipTextfield().getText(), "");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user