mirror of https://github.com/vector-im/riot-web
make beacon events more specific (#9186)
parent
0dffc582e7
commit
05e179f856
|
@ -51,13 +51,13 @@ describe('<BeaconStatus />', () => {
|
||||||
it('renders without children', () => {
|
it('renders without children', () => {
|
||||||
// mock for stable snapshot
|
// mock for stable snapshot
|
||||||
jest.spyOn(Date, 'now').mockReturnValue(123456789);
|
jest.spyOn(Date, 'now').mockReturnValue(123456789);
|
||||||
const beacon = new Beacon(makeBeaconInfoEvent('@user:server', '!room:server', {}, '$1'));
|
const beacon = new Beacon(makeBeaconInfoEvent('@user:server', '!room:server', { isLive: false }, '$1'));
|
||||||
const component = getComponent({ beacon, displayStatus: BeaconDisplayStatus.Active });
|
const component = getComponent({ beacon, displayStatus: BeaconDisplayStatus.Active });
|
||||||
expect(component).toMatchSnapshot();
|
expect(component).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders with children', () => {
|
it('renders with children', () => {
|
||||||
const beacon = new Beacon(makeBeaconInfoEvent('@user:server', '!room:sever'));
|
const beacon = new Beacon(makeBeaconInfoEvent('@user:server', '!room:sever', { isLive: false }));
|
||||||
const component = getComponent({
|
const component = getComponent({
|
||||||
beacon,
|
beacon,
|
||||||
children: <span data-test-id='test'>test</span>,
|
children: <span data-test-id='test'>test</span>,
|
||||||
|
@ -69,7 +69,7 @@ describe('<BeaconStatus />', () => {
|
||||||
it('renders static remaining time when displayLiveTimeRemaining is falsy', () => {
|
it('renders static remaining time when displayLiveTimeRemaining is falsy', () => {
|
||||||
// mock for stable snapshot
|
// mock for stable snapshot
|
||||||
jest.spyOn(Date, 'now').mockReturnValue(123456789);
|
jest.spyOn(Date, 'now').mockReturnValue(123456789);
|
||||||
const beacon = new Beacon(makeBeaconInfoEvent('@user:server', '!room:server', {}, '$1'));
|
const beacon = new Beacon(makeBeaconInfoEvent('@user:server', '!room:server', { isLive: false }, '$1'));
|
||||||
const component = getComponent({ beacon, displayStatus: BeaconDisplayStatus.Active });
|
const component = getComponent({ beacon, displayStatus: BeaconDisplayStatus.Active });
|
||||||
expect(component.text().includes('Live until 11:17')).toBeTruthy();
|
expect(component.text().includes('Live until 11:17')).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
@ -77,7 +77,7 @@ describe('<BeaconStatus />', () => {
|
||||||
it('renders live time remaining when displayLiveTimeRemaining is truthy', () => {
|
it('renders live time remaining when displayLiveTimeRemaining is truthy', () => {
|
||||||
// mock for stable snapshot
|
// mock for stable snapshot
|
||||||
jest.spyOn(Date, 'now').mockReturnValue(123456789);
|
jest.spyOn(Date, 'now').mockReturnValue(123456789);
|
||||||
const beacon = new Beacon(makeBeaconInfoEvent('@user:server', '!room:server', {}, '$1'));
|
const beacon = new Beacon(makeBeaconInfoEvent('@user:server', '!room:server', { isLive: false }, '$1'));
|
||||||
const component = getComponent({
|
const component = getComponent({
|
||||||
beacon, displayStatus: BeaconDisplayStatus.Active,
|
beacon, displayStatus: BeaconDisplayStatus.Active,
|
||||||
displayLiveTimeRemaining: true,
|
displayLiveTimeRemaining: true,
|
||||||
|
|
|
@ -9,13 +9,13 @@ exports[`<BeaconStatus /> active state renders without children 1`] = `
|
||||||
"_beaconInfo": Object {
|
"_beaconInfo": Object {
|
||||||
"assetType": "m.self",
|
"assetType": "m.self",
|
||||||
"description": undefined,
|
"description": undefined,
|
||||||
"live": undefined,
|
"live": false,
|
||||||
"timeout": 3600000,
|
"timeout": 3600000,
|
||||||
"timestamp": 123456789,
|
"timestamp": 123456789,
|
||||||
},
|
},
|
||||||
"_events": Object {},
|
"_events": Object {},
|
||||||
"_eventsCount": 0,
|
"_eventsCount": 0,
|
||||||
"_isLive": undefined,
|
"_isLive": false,
|
||||||
"_latestLocationEvent": undefined,
|
"_latestLocationEvent": undefined,
|
||||||
"_maxListeners": undefined,
|
"_maxListeners": undefined,
|
||||||
"clearLatestLocation": [Function],
|
"clearLatestLocation": [Function],
|
||||||
|
@ -24,7 +24,7 @@ exports[`<BeaconStatus /> active state renders without children 1`] = `
|
||||||
"rootEvent": Object {
|
"rootEvent": Object {
|
||||||
"content": Object {
|
"content": Object {
|
||||||
"description": undefined,
|
"description": undefined,
|
||||||
"live": undefined,
|
"live": false,
|
||||||
"org.matrix.msc3488.asset": Object {
|
"org.matrix.msc3488.asset": Object {
|
||||||
"type": "m.self",
|
"type": "m.self",
|
||||||
},
|
},
|
||||||
|
@ -71,13 +71,13 @@ exports[`<BeaconStatus /> active state renders without children 1`] = `
|
||||||
"_beaconInfo": Object {
|
"_beaconInfo": Object {
|
||||||
"assetType": "m.self",
|
"assetType": "m.self",
|
||||||
"description": undefined,
|
"description": undefined,
|
||||||
"live": undefined,
|
"live": false,
|
||||||
"timeout": 3600000,
|
"timeout": 3600000,
|
||||||
"timestamp": 123456789,
|
"timestamp": 123456789,
|
||||||
},
|
},
|
||||||
"_events": Object {},
|
"_events": Object {},
|
||||||
"_eventsCount": 0,
|
"_eventsCount": 0,
|
||||||
"_isLive": undefined,
|
"_isLive": false,
|
||||||
"_latestLocationEvent": undefined,
|
"_latestLocationEvent": undefined,
|
||||||
"_maxListeners": undefined,
|
"_maxListeners": undefined,
|
||||||
"clearLatestLocation": [Function],
|
"clearLatestLocation": [Function],
|
||||||
|
@ -86,7 +86,7 @@ exports[`<BeaconStatus /> active state renders without children 1`] = `
|
||||||
"rootEvent": Object {
|
"rootEvent": Object {
|
||||||
"content": Object {
|
"content": Object {
|
||||||
"description": undefined,
|
"description": undefined,
|
||||||
"live": undefined,
|
"live": false,
|
||||||
"org.matrix.msc3488.asset": Object {
|
"org.matrix.msc3488.asset": Object {
|
||||||
"type": "m.self",
|
"type": "m.self",
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue