diff --git a/tests/integration/targets/grafana_folder/tasks/org.yml b/tests/integration/targets/grafana_folder/tasks/org.yml index f30d48c1..7a628914 100644 --- a/tests/integration/targets/grafana_folder/tasks/org.yml +++ b/tests/integration/targets/grafana_folder/tasks/org.yml @@ -1,7 +1,53 @@ --- - module_defaults: community.grafana.grafana_folder: - org_name: Main Org. + url: "{{ grafana_url }}" + url_username: "{{ grafana_username }}" + url_password: "{{ grafana_password }}" + org_name: "Main Org." block: - - name: Folder creation and deletion - ansible.builtin.include_tasks: create-delete.yml + - name: Create a Folder + community.grafana.grafana_folder: + title: grafana_working_group + state: present + register: result + + - ansible.builtin.assert: + that: + - result.changed == true + - result.folder.title == 'grafana_working_group' + when: not ansible_check_mode + + - name: Test folder creation idempotency + community.grafana.grafana_folder: + title: grafana_working_group + state: present + register: result + + - ansible.builtin.assert: + that: + - result.changed == false + - result.folder.title == 'grafana_working_group' + when: not ansible_check_mode + + - name: Delete a Folder + community.grafana.grafana_folder: + title: grafana_working_group + state: absent + register: result + + - ansible.builtin.assert: + that: + - result.changed == true + when: not ansible_check_mode + + - name: Test folder deletion idempotency + community.grafana.grafana_folder: + title: grafana_working_group + state: absent + register: result + + - ansible.builtin.assert: + that: + - result.changed == false + when: not ansible_check_mode