Browse Source

actually run the new test and remove unrelated tweak

pull/13138/head
Michael Telatynski 2 months ago
parent
commit
26fef6f294
  1. 2
      package.json
  2. 5
      src/@types/global.d.ts
  3. 10
      test/unit-tests/url_utils-test.ts

2
package.json

@ -153,7 +153,7 @@
"jest": {
"testEnvironment": "jest-environment-jsdom-sixteen",
"testMatch": [
"<rootDir>/test/**/*-test.js"
"<rootDir>/test/**/*-test.[tj]s"
],
"setupFilesAfterEnv": [
"<rootDir>/node_modules/matrix-react-sdk/test/setupTests.js"

5
src/@types/global.d.ts

@ -35,11 +35,6 @@ type ElectronChannel =
declare global {
interface Window {
Modernizr: ModernizrAPI & FeatureDetects;
Olm: {
init: () => Promise<void>;
};
mxSendRageshake: (text: string, withLogs?: boolean) => void;
matrixChat: ReturnType<Renderer>;

10
test/unit-tests/url_utils-test.ts

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import {parseQsFromFragment, parseQs} from "../../src/vector/url_utils";
import { parseQsFromFragment, parseQs } from "../../src/vector/url_utils";
describe("url_utils.ts", function() {
// @ts-ignore
@ -39,4 +39,12 @@ describe("url_utils.ts", function() {
"foo": "bar",
});
});
describe("parseQs with arrays", function() {
location.search = "?via=s1&via=s2&via=s2&foo=bar";
expect(parseQs(location)).toEqual({
"via": ["s1", "s2", "s2"],
"foo": "bar",
});
});
});
Loading…
Cancel
Save