From e7d11c7c1173d07db741301053db78b835a73ab3 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Fri, 14 Jan 2022 22:48:01 +0100 Subject: add settings page with styling --- test/unit/test_item_preview.py | 55 +++--------------------------------------- 1 file changed, 3 insertions(+), 52 deletions(-) (limited to 'test/unit/test_item_preview.py') diff --git a/test/unit/test_item_preview.py b/test/unit/test_item_preview.py index c3aaf1f..6148bc2 100644 --- a/test/unit/test_item_preview.py +++ b/test/unit/test_item_preview.py @@ -24,52 +24,6 @@ from ..extension_crafting import ExtraHTML from ..script_loader import load_script from .utils import * -broker_js = lambda: load_script('background/broadcast_broker.js') + ';start();' - -def make_sample_mapping(): - return { - 'source_name': 'example-org-fixes-new', - 'source_copyright': [ - sample_file_ref('report.spdx'), - sample_file_ref('LICENSES/CC0-1.0.txt') - ], - 'type': 'mapping', - 'identifier': 'example-org-minimal', - 'long_name': 'Example.org Minimal', - 'uuid': '54d23bba-472e-42f5-9194-eaa24c0e3ee7', - 'version': [2022, 5, 10], - 'description': 'suckless something something', - 'payloads': { - 'https://example.org/a/*': { - 'identifier': 'some-KISS-resource' - }, - 'https://example.org/t/*': { - 'identifier': 'another-KISS-resource' - } - } - } - -def make_sample_resource(): - return { - 'source_name': 'hello', - 'source_copyright': [ - sample_file_ref('report.spdx'), - sample_file_ref('LICENSES/CC0-1.0.txt') - ], - 'type': 'resource', - 'identifier': 'helloapple', - 'long_name': 'Hello Apple', - 'uuid': 'a6754dcb-58d8-4b7a-a245-24fd7ad4cd68', - 'version': [2021, 11, 10], - 'revision': 1, - 'description': 'greets an apple', - 'dependencies': ['hello-message'], - 'scripts': [ - sample_file_ref('hello.js'), - sample_file_ref('bye.js') - ] - } - @pytest.mark.ext_data({ 'extra_html': ExtraHTML('html/item_preview.html', {}), 'navigate_to': 'html/item_preview.html' @@ -197,16 +151,13 @@ def test_file_preview_link(driver, execute_in_page): # Mock dialog execute_in_page('dialog.error = (...args) => window.error_args = args;') - sample_resource = make_sample_resource() - sample_data = { - 'resources': sample_data_dict([sample_resource]), - 'mappings': {}, - 'files': sample_files_by_hash - } + sample_data = make_complete_sample_data() + sample_data['mappings'] = {} execute_in_page('returnval(haketilodb.save_items(arguments[0]));', sample_data) # Cause the "link" to `bye.js` to be invalid. + sample_resource = make_sample_resource() sample_resource['scripts'][1]['hash_key'] = 'dummy nonexistent key' execute_in_page( -- cgit v1.2.3