mirror of
https://github.com/discourse/discourse.git
synced 2025-06-23 01:32:49 +08:00
DEV: Clean up skipped tests (#15747)
Many of the tests work now that other, general fixes have been made. I've deleted some that seem to have lost functionality.
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
let cdn, baseUrl, baseUri, baseUriMatcher;
|
||||
let S3BaseUrl, S3CDN;
|
||||
|
||||
let snapshot;
|
||||
|
||||
export default function getURL(url) {
|
||||
if (baseUri === undefined) {
|
||||
setPrefix($('meta[name="discourse-base-uri"]').attr("content") || "");
|
||||
@ -59,15 +61,43 @@ export function setPrefix(configBaseUri) {
|
||||
baseUriMatcher = new RegExp(`^${baseUri}(/|$)`);
|
||||
}
|
||||
|
||||
export function setupURL(configCdn, configBaseUrl, configBaseUri) {
|
||||
export function setupURL(configCdn, configBaseUrl, configBaseUri, opts) {
|
||||
opts = opts || {};
|
||||
cdn = configCdn;
|
||||
baseUrl = configBaseUrl;
|
||||
setPrefix(configBaseUri);
|
||||
|
||||
if (opts?.snapshot) {
|
||||
snapshot = {
|
||||
cdn,
|
||||
baseUri,
|
||||
baseUrl,
|
||||
configBaseUrl,
|
||||
baseUriMatcher,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export function setupS3CDN(configS3BaseUrl, configS3CDN) {
|
||||
// In a test environment we might change these values and, after tests, want to restore them.
|
||||
export function restoreBaseUri() {
|
||||
if (snapshot) {
|
||||
cdn = snapshot.cdn;
|
||||
baseUri = snapshot.baseUri;
|
||||
baseUrl = snapshot.baseUrl;
|
||||
baseUriMatcher = snapshot.baseUriMatcher;
|
||||
S3BaseUrl = snapshot.S3BaseUrl;
|
||||
S3CDN = snapshot.S3CDN;
|
||||
}
|
||||
}
|
||||
|
||||
export function setupS3CDN(configS3BaseUrl, configS3CDN, opts) {
|
||||
S3BaseUrl = configS3BaseUrl;
|
||||
S3CDN = configS3CDN;
|
||||
if (opts?.snapshot) {
|
||||
snapshot = snapshot || {};
|
||||
snapshot.S3BaseUrl = S3BaseUrl;
|
||||
snapshot.S3CDN = S3CDN;
|
||||
}
|
||||
}
|
||||
|
||||
// We can use this to identify when navigating on the same host but outside of the
|
||||
|
Reference in New Issue
Block a user