mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
feat(alerts): Select tabs to send backend (#17749)
* Adding the extra config and validation * wip * reports working * Tests working * fix type * Fix lint errors * Fixing type issues * add licence header * fix the fixture deleting problem * scope to session * fix integration test * fix review comments * fix review comments patch 2 Co-authored-by: Grace Guo <grace.guo@airbnb.com>
This commit is contained in:
77
tests/integration_tests/fixtures/tabbed_dashboard.py
Normal file
77
tests/integration_tests/fixtures/tabbed_dashboard.py
Normal file
@@ -0,0 +1,77 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import json
|
||||
|
||||
import pytest
|
||||
|
||||
from superset import db
|
||||
from superset.models.dashboard import Dashboard
|
||||
from tests.integration_tests.dashboard_utils import create_dashboard
|
||||
from tests.integration_tests.test_app import app
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def tabbed_dashboard():
|
||||
position_json = {
|
||||
"DASHBOARD_VERSION_KEY": "v2",
|
||||
"GRID_ID": {
|
||||
"children": ["TABS-IpViLohnyP"],
|
||||
"id": "GRID_ID",
|
||||
"parents": ["ROOT_ID"],
|
||||
"type": "GRID",
|
||||
},
|
||||
"HEADER_ID": {
|
||||
"id": "HEADER_ID",
|
||||
"meta": {"text": "tabbed dashboard"},
|
||||
"type": "HEADER",
|
||||
},
|
||||
"ROOT_ID": {"children": ["GRID_ID"], "id": "ROOT_ID", "type": "ROOT"},
|
||||
"TAB-j53G4gtKGF": {
|
||||
"children": [],
|
||||
"id": "TAB-j53G4gtKGF",
|
||||
"meta": {
|
||||
"defaultText": "Tab title",
|
||||
"placeholder": "Tab title",
|
||||
"text": "Tab 1",
|
||||
},
|
||||
"parents": ["ROOT_ID", "GRID_ID", "TABS-IpViLohnyP"],
|
||||
"type": "TAB",
|
||||
},
|
||||
"TAB-nerWR09Ju": {
|
||||
"children": [],
|
||||
"id": "TAB-nerWR09Ju",
|
||||
"meta": {
|
||||
"defaultText": "Tab title",
|
||||
"placeholder": "Tab title",
|
||||
"text": "Tab 2",
|
||||
},
|
||||
"parents": ["ROOT_ID", "GRID_ID", "TABS-IpViLohnyP"],
|
||||
"type": "TAB",
|
||||
},
|
||||
"TABS-IpViLohnyP": {
|
||||
"children": ["TAB-j53G4gtKGF", "TAB-nerWR09Ju"],
|
||||
"id": "TABS-IpViLohnyP",
|
||||
"meta": {},
|
||||
"parents": ["ROOT_ID", "GRID_ID"],
|
||||
"type": "TABS",
|
||||
},
|
||||
}
|
||||
with app.app_context():
|
||||
dash = create_dashboard(
|
||||
"tabbed-dash-test", "Tabbed Dash Test", json.dumps(position_json), []
|
||||
)
|
||||
yield dash
|
||||
Reference in New Issue
Block a user