package guitests.guihandles;

import guitests.GuiRobot;
import javafx.scene.Node;
import javafx.stage.Stage;
import seedu.address.model.person.ReadOnlyTask;

/**
 * Provides a handle to a task card in the person list panel.
 */
public class TaskCardHandle extends GuiHandle {
    private static final String CONTENT_FIELD_ID = "#content";
    private static final String DATE_FIELD_ID = "#date";

    private Node node;

    public TaskCardHandle(GuiRobot guiRobot, Stage primaryStage, Node node){
        super(guiRobot, primaryStage, null);
        this.node = node;
    }

    protected String getTextFromLabel(String fieldId) {
        return getTextFromLabel(fieldId, node);
    }

    public String getContent() {
        return getTextFromLabel(CONTENT_FIELD_ID);
    }

    public String getDate() {
        return getTextFromLabel(DATE_FIELD_ID);
    }



    public boolean isSameTask(ReadOnlyTask task){
        return getContent().toString().equals(task.getContent().value) && getDate().toString().equals(task.getDate().toString());
    }

    @Override
    public boolean equals(Object obj) {
        if(obj instanceof TaskCardHandle) {
            TaskCardHandle handle = (TaskCardHandle) obj;
            return getContent().equals(handle.getContent())
                    && getDate().equals(handle.getDate());
        }
        return super.equals(obj);
    }

    @Override
    public String toString() {
        return getContent() + " " + getDate();
    }
}

@@ -389,16 +389,73 @@
 #date%22;%0A
+    private static final String TAG_FIELD_ID = %22#tags%22;%0A%0A
 %0A    pri
@@ -912,16 +912,103 @@
 ;%0A    %7D%0A
+    %0A    public String getTag() %7B%0A        return getTextFromLabel(TAG_FIELD_ID);%0A    %7D%0A
 %0A%0A%0A    p

change taskcardHandle