diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index be0d5e404c..8630271ce0 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -27,18 +27,12 @@ steps: image: "matrixdotorg/riotweb-ci-e2etests-env:latest" propagate-environment: true - - label: ":karma: Tests" + - label: ":jest: Tests" agents: # We use a medium sized instance instead of the normal small ones because # webpack loves to gorge itself on resources. queue: "medium" command: - # Install chrome - - "echo '--- Installing Chrome'" - - "wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -" - - "sh -c 'echo \"deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main\" >> /etc/apt/sources.list.d/google.list'" - - "apt-get update" - - "apt-get install -y google-chrome-stable" # Run tests # TODO: Remove hacky chmod for BuildKite - "chmod +x ./scripts/ci/*.sh" @@ -47,8 +41,6 @@ steps: - "./scripts/ci/install-deps.sh" - "echo '+++ Running Tests'" - "./scripts/ci/unit-tests.sh" - env: - CHROME_BIN: "/usr/bin/google-chrome-stable" plugins: - docker#v3.0.1: image: "node:10" diff --git a/test/stores/RoomViewStore-test.js b/test/stores/RoomViewStore-test.js index 83ec3d9c2e..f227ae69ab 100644 --- a/test/stores/RoomViewStore-test.js +++ b/test/stores/RoomViewStore-test.js @@ -27,13 +27,7 @@ describe('RoomViewStore', function() { }); it('can be used to view a room by alias and join', function(done) { - peg.get().getRoomIdForAlias.mockResolvedValue({room_id: "!randomcharacters:aser.ver"}); - peg.get().joinRoom = async (roomAddress) => { - expect(roomAddress).toBe("#somealias2:aser.ver"); - done(); - }; - - RoomViewStore.addListener(() => { + const token = RoomViewStore.addListener(() => { // Wait until the room alias has resolved and the room ID is if (!RoomViewStore.isRoomLoading()) { expect(RoomViewStore.getRoomId()).toBe("!randomcharacters:aser.ver"); @@ -42,6 +36,13 @@ describe('RoomViewStore', function() { } }); + peg.get().getRoomIdForAlias.mockResolvedValue({room_id: "!randomcharacters:aser.ver"}); + peg.get().joinRoom = async (roomAddress) => { + token.remove(); // stop RVS listener + expect(roomAddress).toBe("#somealias2:aser.ver"); + done(); + }; + dispatch({ action: 'view_room', room_alias: '#somealias2:aser.ver' }); }); });