include /test/stores in tsconfig (#8026)
* fix space store emits Signed-off-by: Kerry Archibald <kerrya@element.io> * fix spacestore-test imports * fix export-test.tsx Signed-off-by: Kerry Archibald <kerrya@element.io> * include test/utils to tsconfig Signed-off-by: Kerry Archibald <kerrya@element.io> * fix types in SpaceStore-test Signed-off-by: Kerry Archibald <kerrya@element.io> * fix ts issues in rest of test/stores Signed-off-by: Kerry Archibald <kerrya@element.io> * include test/stores in tsconfig Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
@@ -13,6 +13,7 @@ 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 { mocked } from 'jest-mock';
|
||||
|
||||
import "../../skinned-sdk"; // Must be first for skinning to work
|
||||
import { SpaceWatcher } from "../../../src/stores/room-list/SpaceWatcher";
|
||||
@@ -49,7 +50,7 @@ const space2 = "!space2:server";
|
||||
describe("SpaceWatcher", () => {
|
||||
stubClient();
|
||||
const store = SpaceStore.instance;
|
||||
const client = MatrixClientPeg.get();
|
||||
const client = mocked(MatrixClientPeg.get());
|
||||
|
||||
let rooms = [];
|
||||
const mkSpaceForRooms = (spaceId: string, children: string[] = []) => mkSpace(client, spaceId, rooms, children);
|
||||
|
||||
@@ -15,6 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { mocked } from 'jest-mock';
|
||||
import { Room } from "matrix-js-sdk/src/matrix";
|
||||
|
||||
import SettingsStore from "../../../../src/settings/SettingsStore";
|
||||
import { FILTER_CHANGED } from "../../../../src/stores/room-list/filters/IFilterCondition";
|
||||
|
||||
@@ -14,15 +14,15 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { MatrixEvent } from "matrix-js-sdk/src/matrix";
|
||||
import { MatrixEvent, MatrixClient } from "matrix-js-sdk/src/matrix";
|
||||
import { POLL_ANSWER, M_TEXT, M_POLL_KIND_DISCLOSED, M_POLL_START } from "matrix-events-sdk";
|
||||
|
||||
import { PollStartEventPreview } from "../../../../src/stores/room-list/previews/PollStartEventPreview";
|
||||
import { MatrixClientPeg } from "../../../../src/MatrixClientPeg";
|
||||
|
||||
MatrixClientPeg.matrixClient = {
|
||||
jest.spyOn(MatrixClientPeg, 'get').mockReturnValue({
|
||||
getUserId: () => "@me:example.com",
|
||||
};
|
||||
} as unknown as MatrixClient);
|
||||
|
||||
describe("PollStartEventPreview", () => {
|
||||
it("shows the question for a poll I created", async () => {
|
||||
|
||||
Reference in New Issue
Block a user