// TODO nf-core: Once you have added the required tests, please run the following command to build this file:
// nf-core modules test {{ component_name }}
nextflow_process {

    name "Test Process {{ component_name_underscore|upper }}"
    script "../main.nf"
    process "{{ component_name_underscore|upper }}"

    tag "modules"
    tag "modules_{{ org_alphabet }}"
    {%- if subtool %}
    tag "{{ component }}"
    {%- endif %}
    tag "{{ component_name }}"

    // TODO nf-core: Change the test name preferably indicating the test-data and file-format used
    test("sarscov2 - bam") {

        // TODO nf-core: If you are created a test for a chained module
        // (the module requires running more than one process to generate the required output)
        // add the 'setup' method here.
        // You can find more information about how to use a 'setup' method in the docs (https://nf-co.re/docs/contributing/modules#steps-for-creating-nf-test-for-chained-modules).

        when {
            process {
                """
                // TODO nf-core: define inputs of the process here. Example:
                {% if has_meta %}
                input[0] = [
                    [ id:'test', single_end:false ], // meta map
                    file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
                ]
                {%- else %}
                input[0] = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
                {%- endif %}
                """
            }
        }

        then {
            assertAll(
                { assert process.success },
                { assert snapshot(process.out).match() }
                //TODO nf-core: Add all required assertions to verify the test output.
                // See https://nf-co.re/docs/contributing/tutorials/nf-test_assertions for more information and examples.
            )
        }

    }

    // TODO nf-core: Change the test name preferably indicating the test-data and file-format used but keep the " - stub" suffix.
    test("sarscov2 - bam - stub") {

        options "-stub"

        when {
            process {
                """
                // TODO nf-core: define inputs of the process here. Example:
                {% if has_meta %}
                input[0] = [
                    [ id:'test', single_end:false ], // meta map
                    file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
                ]
                {%- else %}
                input[0] = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
                {%- endif %}
                """
            }
        }

        then {
            assertAll(
                { assert process.success },
                { assert snapshot(process.out).match() }
                //TODO nf-core: Add all required assertions to verify the test output.
            )
        }

    }

}
