|
|
|
|
@ -16,13 +16,15 @@ const createMatch = (args: Args) => ({ |
|
|
|
|
...args, |
|
|
|
|
} as Match) |
|
|
|
|
|
|
|
|
|
const user = undefined |
|
|
|
|
|
|
|
|
|
it('equals to no country access type', () => { |
|
|
|
|
const match = createMatch({ |
|
|
|
|
access: false, |
|
|
|
|
sub: false, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
expect(getMatchAccess(match)).toBe(MatchAccess.CanBuyMatch) |
|
|
|
|
expect(getMatchAccess(match, user)).toBe(MatchAccess.ViewMatchPopupWithoutUser) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
it('equals to redirect type', () => { |
|
|
|
|
@ -34,7 +36,7 @@ it('equals to redirect type', () => { |
|
|
|
|
sub: true, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
expect(getMatchAccess(match)).toBe(MatchAccess.RedirectToProfile) |
|
|
|
|
expect(getMatchAccess(match, user)).toBe(MatchAccess.ViewMatchPopupWithoutUser) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
it('equals to can buy type', () => { |
|
|
|
|
@ -43,7 +45,7 @@ it('equals to can buy type', () => { |
|
|
|
|
sub: false, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
expect(getMatchAccess(match)).toBe(MatchAccess.CanBuyMatch) |
|
|
|
|
expect(getMatchAccess(match, user)).toBe(MatchAccess.ViewMatchPopupWithoutUser) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
it('equals to view match popup type', () => { |
|
|
|
|
@ -54,7 +56,7 @@ it('equals to view match popup type', () => { |
|
|
|
|
sub: true, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
expect(getMatchAccess(match)).toBe(MatchAccess.ViewMatchPopup) |
|
|
|
|
expect(getMatchAccess(match, user)).toBe(MatchAccess.ViewMatchPopupWithoutUser) |
|
|
|
|
|
|
|
|
|
match = createMatch({ |
|
|
|
|
access: true, |
|
|
|
|
@ -65,7 +67,7 @@ it('equals to view match popup type', () => { |
|
|
|
|
sub: true, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
expect(getMatchAccess(match)).toBe(MatchAccess.RedirectToProfile) |
|
|
|
|
expect(getMatchAccess(match, user)).toBe(MatchAccess.ViewMatchPopupWithoutUser) |
|
|
|
|
|
|
|
|
|
match = createMatch({ |
|
|
|
|
access: true, |
|
|
|
|
@ -77,5 +79,5 @@ it('equals to view match popup type', () => { |
|
|
|
|
sub: true, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
expect(getMatchAccess(match)).toBe(MatchAccess.ViewMatchPopup) |
|
|
|
|
expect(getMatchAccess(match, user)).toBe(MatchAccess.NoAccess) |
|
|
|
|
}) |
|
|
|
|
|