Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
47 lines
1.2 KiB
Plaintext
47 lines
1.2 KiB
Plaintext
import { describe, it, expect } from 'vitest';
|
|
import { fieldHasChanges } from './fieldHasChanges.js';
|
|
describe('hasChanges', () => {
|
|
it('should return false for identical values', () => {
|
|
const a = 'value';
|
|
const b = 'value';
|
|
expect(fieldHasChanges(a, b)).toBe(false);
|
|
});
|
|
it('should return true for different values', () => {
|
|
const a = 1;
|
|
const b = 2;
|
|
expect(fieldHasChanges(a, b)).toBe(true);
|
|
});
|
|
it('should return false for identical objects', () => {
|
|
const a = {
|
|
key: 'value'
|
|
};
|
|
const b = {
|
|
key: 'value'
|
|
};
|
|
expect(fieldHasChanges(a, b)).toBe(false);
|
|
});
|
|
it('should return true for different objects', () => {
|
|
const a = {
|
|
key: 'value'
|
|
};
|
|
const b = {
|
|
key: 'differentValue'
|
|
};
|
|
expect(fieldHasChanges(a, b)).toBe(true);
|
|
});
|
|
it('should handle undefined values', () => {
|
|
const a = {
|
|
key: 'value'
|
|
};
|
|
const b = undefined;
|
|
expect(fieldHasChanges(a, b)).toBe(true);
|
|
});
|
|
it('should handle null values', () => {
|
|
const a = {
|
|
key: 'value'
|
|
};
|
|
const b = null;
|
|
expect(fieldHasChanges(a, b)).toBe(true);
|
|
});
|
|
});
|
|
//# sourceMappingURL=fieldHasChanges.spec.js.map |