import { act, render, screen, waitFor } from '@testing-library/react'

import { createRemixStub, RemixStubProps } from "@remix-run/testing"
import App from './root'
import React from 'react'
let RemixStub: (props: RemixStubProps) => React.JSX.Element

describe("root", () => {
    beforeEach(() => {
        RemixStub = createRemixStub([
            {
                path: "/",
                meta: () => ([]),
                links: () => ([]),
                Component: App
            }
        ])
    })

    describe("when user is on iOS", () => {
        describe("version 16.4 or higher", () => {
            describe("and tack up now is not already installed on their device", () => {
                test("they are instructed to install tack up now", async () => {
                    render(<RemixStub/>)
                    let x: number = 4
                    await waitFor(() => screen.findByText<HTMLElement>("Whoah"), { timeout: 2000 })
                    console.log("YES HI")

                    expect(true).toBe(true)
                })
            })

            // describe("and tack up now is already installed on their device", () => {
            //     describe("and they are not in standalone mode", () => {
                    
            //     })
            // })

        })
    })
})
