Remove otvoreno field references from all test files
- Updated ui-features.test.ts to remove otvoreno field expectations - Updated api-integration.test.ts to remove otvoreno from test data - Updated data-consistency.test.ts to remove otvoreno from structure definitions - Updated filament-crud.test.ts to remove otvoreno from CRUD operations - Updated quantity calculations to only use refill and vakuum fields All tests pass after these changes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -37,7 +37,6 @@ describe('Filament CRUD Operations', () => {
|
||||
bojaHex: '#000000',
|
||||
refill: '2',
|
||||
vakum: '1 vakuum',
|
||||
otvoreno: 'Ne',
|
||||
kolicina: '3',
|
||||
cena: '3999'
|
||||
};
|
||||
@@ -70,7 +69,6 @@ describe('Filament CRUD Operations', () => {
|
||||
bojaHex: '#FF0000',
|
||||
refill: 'Ne',
|
||||
vakum: 'Ne',
|
||||
otvoreno: 'Ne',
|
||||
kolicina: '1',
|
||||
cena: '4500'
|
||||
};
|
||||
@@ -98,7 +96,6 @@ describe('Filament CRUD Operations', () => {
|
||||
bojaHex: '#0000FF',
|
||||
refill: '1',
|
||||
vakum: '2 vakuum',
|
||||
otvoreno: '1 otvorena',
|
||||
kolicina: '4',
|
||||
cena: '5000'
|
||||
};
|
||||
@@ -148,7 +145,6 @@ describe('Filament CRUD Operations', () => {
|
||||
boja_hex: '#000000',
|
||||
refill: '2',
|
||||
vakum: '1 vakuum',
|
||||
otvoreno: 'Ne',
|
||||
kolicina: '3',
|
||||
cena: '3999'
|
||||
},
|
||||
@@ -160,7 +156,6 @@ describe('Filament CRUD Operations', () => {
|
||||
boja_hex: '#FF0000',
|
||||
refill: 'Ne',
|
||||
vakum: 'Ne',
|
||||
otvoreno: 'Ne',
|
||||
kolicina: '1',
|
||||
cena: '4500'
|
||||
}
|
||||
@@ -182,15 +177,15 @@ describe('Filament CRUD Operations', () => {
|
||||
});
|
||||
|
||||
describe('Quantity Calculations', () => {
|
||||
it('should correctly calculate total quantity from refill, vakuum, and otvoreno', () => {
|
||||
it('should correctly calculate total quantity from refill and vakuum', () => {
|
||||
const testCases = [
|
||||
{ refill: '2', vakum: '1 vakuum', otvoreno: 'Ne', expected: 3 },
|
||||
{ refill: 'Ne', vakum: '3 vakuum', otvoreno: '2 otvorena', expected: 5 },
|
||||
{ refill: '1', vakum: 'Ne', otvoreno: 'Ne', expected: 1 },
|
||||
{ refill: 'Da', vakum: 'vakuum', otvoreno: 'otvorena', expected: 3 }
|
||||
{ refill: '2', vakum: '1 vakuum', expected: 3 },
|
||||
{ refill: 'Ne', vakum: '3 vakuum', expected: 3 },
|
||||
{ refill: '1', vakum: 'Ne', expected: 1 },
|
||||
{ refill: 'Da', vakum: 'vakuum', expected: 2 }
|
||||
];
|
||||
|
||||
testCases.forEach(({ refill, vakum, otvoreno, expected }) => {
|
||||
testCases.forEach(({ refill, vakum, expected }) => {
|
||||
// Parse refill
|
||||
const refillCount = parseInt(refill) || (refill?.toLowerCase() === 'da' ? 1 : 0);
|
||||
|
||||
@@ -198,11 +193,7 @@ describe('Filament CRUD Operations', () => {
|
||||
const vakuumMatch = vakum?.match(/^(\d+)\s*vakuum/);
|
||||
const vakuumCount = vakuumMatch ? parseInt(vakuumMatch[1]) : (vakum?.toLowerCase().includes('vakuum') ? 1 : 0);
|
||||
|
||||
// Parse otvoreno
|
||||
const otvorenMatch = otvoreno?.match(/^(\d+)\s*otvorena/);
|
||||
const otvorenCount = otvorenMatch ? parseInt(otvorenMatch[1]) : (otvoreno?.toLowerCase().includes('otvorena') ? 1 : 0);
|
||||
|
||||
const total = refillCount + vakuumCount + otvorenCount;
|
||||
const total = refillCount + vakuumCount;
|
||||
|
||||
expect(total).toBe(expected);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user