Repository Public
1// SP Notes iOS2// File: Tests/DesignMotionTests.swift3// Description: The signature motions decided by the shell, on both paths: motion allowed and Reduce Motion.4//5// Author: Simon-Pierre Boucher6// Contact: contact@spboucher.ai7import SPNotesDesign8import SwiftUI9import Testing10@testable import SPNotes1112@Suite("Mouvements signature — Reduce Motion") struct DesignMotionTests {13 @Test func fluidNavigationZoomsOnlyWhenMotionIsAllowed() {14 #expect(SignatureMotion.usesZoom(reduceMotion: false))15 #expect(!SignatureMotion.usesZoom(reduceMotion: true))16 }1718 @Test func livingPagesAnimateTheFirstTwentyFourRowsAndNeverASelection() {19 #expect(SignatureMotion.revealIndex(0, isSelecting: false) == 0)20 #expect(SignatureMotion.revealIndex(23, isSelecting: false) == 23)21 #expect(SignatureMotion.revealIndex(24, isSelecting: false) == nil)22 #expect(SignatureMotion.revealIndex(3, isSelecting: true) == nil)23 #expect(NVMotion.staggerCap == 24)24 }2526 @Test func panelsCrossFadeBrieflyUnderReduceMotion() {27 #expect(SignatureMotion.panelAnimation(reduceMotion: true) == NVMotion.animation(.base, reduceMotion: true))28 #expect(SignatureMotion.panelAnimation(reduceMotion: true) != SignatureMotion.panelAnimation(reduceMotion: false))29 #expect(NVMotion.reducedMaxDuration <= 0.120)30 }31}32