Merged in fix/linting (pull request #2708)
Fix/linting * fix import issues and add lint check no-extraneous-dependencies * fix use type HotelType instead of string Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
import { useIntl } from 'react-intl'
|
||||
|
||||
import { Divider } from '@scandic-hotels/design-system/Divider'
|
||||
import { Typography } from '@scandic-hotels/design-system/Typography'
|
||||
import { Divider } from '../../Divider'
|
||||
import { Typography } from '../../Typography'
|
||||
|
||||
import { getGroupedOpeningHours } from '../utils'
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { getGroupedOpeningHours } from './utils'
|
||||
|
||||
import type { RestaurantOpeningHours } from '@scandic-hotels/trpc/types/hotel'
|
||||
import type { IntlShape } from 'react-intl'
|
||||
import { OpeningHours } from './openingHoursTypes'
|
||||
|
||||
// Mock IntlShape for testing
|
||||
const mockIntl = {
|
||||
@@ -25,7 +25,7 @@ const mockIntl = {
|
||||
|
||||
describe('getGroupedOpeningHours', () => {
|
||||
it('should group all days as closed', () => {
|
||||
const allDaysClosed: RestaurantOpeningHours = {
|
||||
const allDaysClosed: OpeningHours = {
|
||||
isActive: true,
|
||||
name: 'Opening hours',
|
||||
nameEnglish: 'Opening hours',
|
||||
@@ -84,7 +84,7 @@ describe('getGroupedOpeningHours', () => {
|
||||
})
|
||||
|
||||
it('should group all days with same opening hours', () => {
|
||||
const allDaysSameHours: RestaurantOpeningHours = {
|
||||
const allDaysSameHours: OpeningHours = {
|
||||
isActive: true,
|
||||
name: 'Opening hours',
|
||||
nameEnglish: 'Opening hours',
|
||||
@@ -143,7 +143,7 @@ describe('getGroupedOpeningHours', () => {
|
||||
})
|
||||
|
||||
it('should handle mixed opening hours', () => {
|
||||
const mixedOpeningHours: RestaurantOpeningHours = {
|
||||
const mixedOpeningHours: OpeningHours = {
|
||||
isActive: true,
|
||||
name: 'Opening hours',
|
||||
nameEnglish: 'Opening hours',
|
||||
@@ -206,7 +206,7 @@ describe('getGroupedOpeningHours', () => {
|
||||
})
|
||||
|
||||
it('should handle always open days', () => {
|
||||
const someAlwaysOpen: RestaurantOpeningHours = {
|
||||
const someAlwaysOpen: OpeningHours = {
|
||||
isActive: true,
|
||||
name: 'Opening hours',
|
||||
nameEnglish: 'Opening hours',
|
||||
@@ -269,7 +269,7 @@ describe('getGroupedOpeningHours', () => {
|
||||
})
|
||||
|
||||
it('should handle missing days', () => {
|
||||
const missingDays: RestaurantOpeningHours = {
|
||||
const missingDays: OpeningHours = {
|
||||
isActive: true,
|
||||
name: 'Opening hours',
|
||||
nameEnglish: 'Opening hours',
|
||||
@@ -304,7 +304,7 @@ describe('getGroupedOpeningHours', () => {
|
||||
})
|
||||
|
||||
it('should not group non-consecutive days with same hours', () => {
|
||||
const nonConsecutiveSameHours: RestaurantOpeningHours = {
|
||||
const nonConsecutiveSameHours: OpeningHours = {
|
||||
isActive: true,
|
||||
name: 'Opening hours',
|
||||
nameEnglish: 'Opening hours',
|
||||
@@ -339,7 +339,7 @@ describe('getGroupedOpeningHours', () => {
|
||||
})
|
||||
|
||||
it('should handle nullable opening/closing times', () => {
|
||||
const nullableHours: RestaurantOpeningHours = {
|
||||
const nullableHours: OpeningHours = {
|
||||
isActive: true,
|
||||
name: 'Opening hours',
|
||||
nameEnglish: 'Opening hours',
|
||||
@@ -374,7 +374,7 @@ describe('getGroupedOpeningHours', () => {
|
||||
})
|
||||
|
||||
it('should handle inactive restaurant hours', () => {
|
||||
const inactiveHours: RestaurantOpeningHours = {
|
||||
const inactiveHours: OpeningHours = {
|
||||
isActive: false,
|
||||
name: 'Opening hours',
|
||||
nameEnglish: 'Opening hours',
|
||||
|
||||
Reference in New Issue
Block a user